Jump to content

Recommended Posts

[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>
<?php
if ($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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.