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
https://forums.phpfreaks.com/topic/93150-ensuring-all-text-feilds-contain-date/
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

 

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.