burge124 Posted February 26, 2008 Share Posted February 26, 2008 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 More sharing options...
amites Posted February 26, 2008 Share Posted February 26, 2008 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 https://forums.phpfreaks.com/topic/93150-ensuring-all-text-feilds-contain-date/#findComment-477205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.