greed460 Posted March 24, 2009 Share Posted March 24, 2009 It seems that the POST is getting information from the form, optionalinfo. But seem to lack the ability to get information using the POST method from the form, requiredinfo. It's probably something simple, but I've read and reread this. PHP: function randverify() { $rand1 = rand(1,9); $rand2 = rand(1,9); $total = $rand1 + $rand2; echo "$rand1 + $rand2 = ?"; } $submit = $_POST["submit"]; //necessary info $username = $_POST["username"]; $password = $_POST["password"]; $confpass = $_POST["confpass"]; $email = $_POST["email"]; $verification = $_POST["verify"]; $date = date("Y-m-d"); //optional info $firstname = $_POST["firstname"]; $lastname = $_POST["lastname"]; $age = $_POST["age"]; $aim = $_POST["aimname"]; $xfire = $_POST["xfirename"]; $iq = $_POST["iq"]; //check if submit button has been pressed if ($submit) { if ($username && $password && $confpass && $email) { $password = md5($password); $confpass = md5($confpass); if ($password==$confpass) { if (strlen($password) < 5 || strlen($confpass) < 5) { echo "<p align='center'<b>Password must be at least <u>6</u> characters long!</b></p>"; } else { //register the user! } } else { echo "<p align='center'<b>Passwords do <u>not</u> match!</b></p>"; } } else { echo "<p align='center'<b>Please fill in <u>all required fields</u>!</b></p>"; } } HTML (form for the related problems): <form action="register.php" name="requiredinfo" method=POST> <table align="center" cellspacing="2" cellpadding="2" border="2" bordercolor="#D7D7D7 " bordercolordark="black" bgcolor="#979797"> <th>Required Information</th> <tr><td> *Username: <input type="text" name="username" maxlength="15"> </td></tr> <tr><td> *Password: <input type="password" name="password" maxlength="20"> </td></tr> <tr><td> *Confirm Password: <input type="password" name="confpass" maxlength="20"> </td></tr> <tr><td> *Email: <input type="text" name="email" maxlength="25"> </td></tr> </table> <table align="center" cellspacing="2" cellpadding="2" border="2" bordercolor="#D7D7D7 " bordercolordark="black" bgcolor="#979797"> <th>*Human Verification</th> <tr><td> <input type="text" name="verify" maxlength="2"> </td> <td> <?php randverify(); ?> </td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/150825-solved-not-getting-information-from-table-using-post-method/ Share on other sites More sharing options...
FaT3oYCG Posted March 24, 2009 Share Posted March 24, 2009 method="post" Link to comment https://forums.phpfreaks.com/topic/150825-solved-not-getting-information-from-table-using-post-method/#findComment-792398 Share on other sites More sharing options...
redarrow Posted March 24, 2009 Share Posted March 24, 2009 You must off got excited, and forgot the main piece of scripting code in the world. <form action="register.php" name="requiredinfo" method=POST> <<<"POST" Link to comment https://forums.phpfreaks.com/topic/150825-solved-not-getting-information-from-table-using-post-method/#findComment-792402 Share on other sites More sharing options...
greed460 Posted March 24, 2009 Author Share Posted March 24, 2009 Hahahaha. Uhm... yeah this is just a tad embarrassing... Uhm... I guess i shouldn't work at 2-6am anymore. Wow... that is stupid lol! Link to comment https://forums.phpfreaks.com/topic/150825-solved-not-getting-information-from-table-using-post-method/#findComment-792481 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.