Jump to content

ensuring all text feilds contain date


burge124

Recommended Posts

hi,

 

what method should i use to ensure when a user is registering to a system that all of the feilds contain some information, otherwise the page simply reloads or shows up an error message? this includes ensuring that email address contains a '@' and password and password2 are identical. thanks ian

 

here is my form

 

<form action="successfullogin.php" method="post">

<p> Username:

    <input type="text" name="UserName" />

</p>

<p>

  Password:

            <input type="text" name="Password" />

</p>

<p>

  <!-- checkEmail used to ensure its an email address returns true -->

  Confirm Password

  <input type="text" name="Password2" />

  </p>

<p>Email Address:

  <input type="text" name="Email" />

  </p>

<p>

      <input name="submit" type="submit" class="subHeader" id="submit" value="Submit" />

<input name="reset" type="reset" class="subHeader" onclick="reset(); return false;" value="Refresh" />

 

</p>

  </FORM>

 

Link to comment
Share on other sites

you can use regex to match the email address,

 

great example in the regex forum in a sticky thread,

 

matching password1 = password2 is as simple as

 

if ($_POST['pass'] == $_POST['pass2']) {

    code for valid

 

} else {

 

    code for invalid

 

}

Link to comment
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.