dadamssg Posted March 14, 2009 Share Posted March 14, 2009 im creating a register script and don't know how to check to see if theres anything in the array and then if so display the contents..heres a piece of what i have. I think i need to go about seeing if $messages is set a diff way. thanks //////Validate each////// if(!eregi("^[A-Za-z0-9' -]{8,14}$",$_POST['username'])) { $messages[]="Username must only be letters and numbers and have at least eight characters.<br>"; } if($_POST['password'] != $_POST['cpassword']) { $messages[]= "Your passwords must match.<br>"; } if(!eregi("^[A-Za-z' -]{3,20}$",$_POST['firstname'])) { $messages[]= "{$_POST['firstname']} is not a valid name.<br>"; } if(!eregi("^[A-Za-z' -]{3,20}$",$_POST['lasstname'])) { $messages[]= "{$_POST['lastname']} is not a valid name.<br>"; } if(isset($messages[])) { extract($_POST); include("register_form.php"); exit(); } Link to comment https://forums.phpfreaks.com/topic/149340-help-with-displaying-error/ Share on other sites More sharing options...
dadamssg Posted March 14, 2009 Author Share Posted March 14, 2009 oh and this on the actual page...its not right though if(isset($messages[])) { echo "$messages[]<br>"; } Link to comment https://forums.phpfreaks.com/topic/149340-help-with-displaying-error/#findComment-784326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.