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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/4646-registration-form/#findComment-16259 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.