nitation Posted June 20, 2008 Share Posted June 20, 2008 I don't know exactly what is wrong with my form2.inc.php, it doesn't insert into my database. When i click on submit, it checks for errors in the fields, and if all is fine, it doesn't show any confirmation message. Below are the codes <?php $intForm = (isset($intForm)) ? $intForm : 1; if ($intForm == 1) { include("form1.inc.php"); } if ($intForm == 2) { include("form2.inc.php"); } ?> applys.php <?php include("connect.php"); $tabsubmit=true; $oktab=false; $msg="Final Step"; if($sub2){ if(trim($PasswordChallenge)==""){ $msg='Check Challenge Question Error'; } if(trim($PasswordResponse)==""){ $msg='Check Answer Field Error'; } if(trim($account_key)==""){ $msg='Check Pin Error'; } if($account_key!=$account_key2){ $msg='Account Pin does not Match'; } if($PasswordResponse!=$PasswordResponse2){ $msg='Challenge Question Answers does not Match'; } else if(($PasswordChallenge) && ($PasswordResponse) && ($account_key) &&($account_key=$account_key2) && ($PasswordResponse!=$PasswordResponse2)){ $sqlsub=mysql_query("insert into test(account_key,PasswordChallenge,PasswordResponse)values('$account_key','$PasswordChallenge','$PasswordResponse')"); } if($sqlsub){ $msg="Thank you for your application. We will contact you shortly."; $tabsubmit=false; $oktab=true; $mailmsg="$hello $surname\n$Reg_Mail_MSG\nAccount ID:$account_id\nAccount Key:$account_key\nEmail:$email\nAccount Type:$account_type\n\n\n$host<br>$our_team"; $send_mail= mail ($email,$Reg_Mail_subject,$mailmsg, "From: $adminmail"); } } include("includes/top_head.php"); include("includes/header.php"); ?> <div id="cont"> <?php if($tabsubmit){ ?> <h3 align="center"><font color="#990000"><?php echo $msg; ?></font></h3> <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" name="myform"> <input type="hidden" name="intForm" value="2"> <?php foreach ($_POST as $strKey => $strValue) { echo "<input type='hidden' name='{$strValue}' value='{$strValue}'>"; } ?> <table width="543" border="1" align="center" bordercolor="#CFD9E2" class="story"> <tr> <td height="37" colspan="2" bgcolor="#cfd9e2" class="formfont"><span style="font-size:10pt; color:#000000;font-weight:bold;">Create a User Name & Password: </span></td> </tr> <tr> <td><div align="right"><strong>* PIN Code:</strong></div></td> <td width="353"><input name="account_key" type="password" id="account_key" value="<?php echo"$account_key2"; ?>" tabindex="301" size="30" maxlength="4"> (4 Digits ONLY) </td> </tr> <tr> <td><div align="right"><strong>* Verify PIN Code: </strong></div></td> <td><input name="account_key2" type="password" id="account_key2" tabindex="301" size="30" maxlength="4"> (4 Digits ONLY) </td> </tr> <tr> <td><div align="right"><strong>* Challenge Question </strong></div></td> <td><input name="PasswordChallenge" type="text" id="PasswordChallenge" size="30" value="<?php echo"$PasswordChallenge"; ?>" maxlength="50" tabindex="303" ></td> </tr> <tr> <td><div align="right"><strong>* Answer</strong></div></td> <td><input name="PasswordResponse" type="text" id="PasswordResponse" tabindex="303" value="<?php echo"$PasswordResponse"; ?>" size="30" maxlength="30" ></td> </tr> <tr> <td><div align="right"><strong> * Verify Answer </strong></div></td> <td><input name="PasswordResponse2" type="text" id="PasswordResponse2" size="30" maxlength="30" value="<?php echo"$PasswordResponse2"; ?>" tabindex="303" ></td> </tr> </table> <p align="center"> <input name="sub2" type="submit" id="sub2" tabindex="303" value="Submit"> <input type="reset" name="Reset" value="Reset" tabindex="303" > <br /> <?php } if($oktab){ ; print "Thank you for your application. We will contact you shortly."; } ?> </p> </form> </div> <?php include("includes/footer.php"); ?> </BODY> </HTML> form2.inc.php The database insert is in form2.inc.php. The error should be coming from there. Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/ Share on other sites More sharing options...
nitation Posted June 20, 2008 Author Share Posted June 20, 2008 No response yet from no one? ??? ??? ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/#findComment-570175 Share on other sites More sharing options...
mark110384 Posted June 20, 2008 Share Posted June 20, 2008 You have a ; right after ($oktab){ ; is that ment to be there? <?php } if($oktab){ print "Thank you for your application. We will contact you shortly."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/#findComment-570185 Share on other sites More sharing options...
nitation Posted June 20, 2008 Author Share Posted June 20, 2008 I have it removed, but its not working yet. Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/#findComment-570190 Share on other sites More sharing options...
nitation Posted June 21, 2008 Author Share Posted June 21, 2008 someone should respond please Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/#findComment-570877 Share on other sites More sharing options...
dannyb785 Posted June 21, 2008 Share Posted June 21, 2008 Dont make files with 2 dots. Not a good idea. just make it form1inc.php. Not saying thats the answer, but it'll get you out of trouble in the future. Also... someone should respond please isn't the right way to approach a FREE forum for php help. Especially since it's only been a day and a half since you posted it. Have patience. Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/#findComment-571133 Share on other sites More sharing options...
eddie_twoFingers Posted June 21, 2008 Share Posted June 21, 2008 I think you should proof read your code first. Quote Link to comment https://forums.phpfreaks.com/topic/111106-solved-database-insert-error/#findComment-571146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.