TheJoey Posted September 4, 2009 Share Posted September 4, 2009 if ($age)<16 && >90) $errorage = true; im getting error with this line of code. Parse error: syntax error, unexpected '<' in C:\xampplite\htdocs\Trial\New Folder\save.php on line 55 Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/ Share on other sites More sharing options...
TheJoey Posted September 4, 2009 Author Share Posted September 4, 2009 if ($age)<16 && >90) $errorage = true; im getting error with this line of code. Parse error: syntax error, unexpected '<' in C:\xampplite\htdocs\Trial\New Folder\save.php on line 55 Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912385 Share on other sites More sharing options...
BinaryG Posted September 4, 2009 Share Posted September 4, 2009 try this if ($age <16 && $age >90) $errorage = true; you need to compare the var in both cases Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912387 Share on other sites More sharing options...
rhodesa Posted September 4, 2009 Share Posted September 4, 2009 this line needs to be changed to: if ($age < 16 && $age > 90) $errorage = true; to make the errors go away...but it doesn't make sense, cus $age can't be less then 16 AND greater 90...do you mean or? if ($age < 16 || $age > 90) $errorage = true; Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912388 Share on other sites More sharing options...
BinaryG Posted September 4, 2009 Share Posted September 4, 2009 yea true missed that one rhodesa Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912391 Share on other sites More sharing options...
TheJoey Posted September 4, 2009 Author Share Posted September 4, 2009 this line needs to be changed to: if ($age < 16 && $age > 90) $errorage = true; to make the errors go away...but it doesn't make sense, cus $age can't be less then 16 AND greater 90...do you mean or? if ($age < 16 || $age > 90) $errorage = true; yer i used those numbers as a example but yer i want the age to be between 16-90 Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912393 Share on other sites More sharing options...
TheJoey Posted September 4, 2009 Author Share Posted September 4, 2009 thanks guys. i ran into another problem on line 82 which has nothing on it. Parse error: syntax error, unexpected $end in C:\xampplite\htdocs\Trial\New Folder\save.php on line 82 Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912397 Share on other sites More sharing options...
rhodesa Posted September 4, 2009 Share Posted September 4, 2009 can you paste all the code? you are probably missing a close brace: } Link to comment https://forums.phpfreaks.com/topic/173100-solved-age-restriction/#findComment-912419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.