aspekt9 Posted March 10, 2006 Share Posted March 10, 2006 [code] <html><body><form action="login.php?page=submit" method="POST">Enter your Username: <input type="text" name="uname" /><br>Enter your Email address: <input type="text" name="email" /><br>Enter your Password: <input type="text" name="password" /><br>Enter your First Name: <input type="text" name="firstname" /><br>Enter your Last Name: <input type="text" name="lastname" /><br><input type="submit value=submit" /></form><?phpif ($page == "submit") { if (!isset($name) || $name == " ") { $error[] = "<b>Error:</b> Username is a required field."; } if (!isset($pass) || $pass = " ") { $error[] = "<b>Error:</b> Password is a required field."; } if (!isset($email) || $email = " ") { $error[] = "<b>Error:</b> Email address is a required field."; } if (!isset($firstname) || $firstname = " ") { $error[] = "<b>Error:</b> First name is a required field."; } if (!isset($lastname) || $lastname = " ") { $error[] = "<b>Error:</b> Last name is a required field."; }if (isset($error)) { $error = serialize($error); header("location: ?page=error&error=$error"); die(); } } if ($page == "error") { $error = unserialize($error); foreach ($problem as $error) { echo $problem.""; }}?></body></html>[/code]can't figure out why it wont work :( any help is greatly appreciated, thanks guys Link to comment https://forums.phpfreaks.com/topic/4646-registration-form/ Share on other sites More sharing options...
lessthanthree Posted March 10, 2006 Share Posted March 10, 2006 [code]if ($page == "submit") {[/code]should be[code]if ($_GET["page"] == "submit") {[/code]there might be some more errors, but on a quick glance that's the one that jumped at me. Link to comment https://forums.phpfreaks.com/topic/4646-registration-form/#findComment-16259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.