redarrow Posted August 20, 2006 Share Posted August 20, 2006 i can not post the whole code as it's 1400 lines long sorry but the example is below cheers.hi there all can you see why the valadation wont work please.does not seem to valadate.[code]<?php$name_lenth=strlen($name);$password_lenth=strlen($password);if(($name_lenth )||($password_lenth) > 15){echo " sorry but name and password are only max 15 characters long ";}?>[/code] Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 20, 2006 Share Posted August 20, 2006 [code]if(($name_lenth )||($password_lenth) > 15){[/code]should be[code]if(($name_lenth > 15) || ($password_lenth > 15)){[/code] Quote Link to comment Share on other sites More sharing options...
Yesideez Posted August 20, 2006 Share Posted August 20, 2006 [code]if ($name_lenth>15||$password_lenth>15) {[/code]That work? Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 20, 2006 Author Share Posted August 20, 2006 what ones more better to use they both work or is it prefrence Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 20, 2006 Share Posted August 20, 2006 They work exactly the same, some people find the parenthesis...()...easier to read, but the functionality is the same. Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 20, 2006 Author Share Posted August 20, 2006 cheers.what i need to now now is when you get a user to fill in a form and use exit and give them a link to go back and try agin do you use sessions to keep there old settings or do you get them to fill it all in agin .or do you keep the most inportant in a session. Quote Link to comment Share on other sites More sharing options...
corbin Posted August 20, 2006 Share Posted August 20, 2006 What i do is if i run into any errors i store them in a $error variable via .= and if there were any errors echo $error and then have the form have the values they just submitted in it by echo the post variables like value="<?=$_POST['name'];?>" That way it doesnt validate but they dont have to retype everything... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.