graham23s Posted January 26, 2008 Share Posted January 26, 2008 Hi Guys, not sure what category this falls into lol but say i use javascript to validate user input, but the users browser doesn't support javascript, would i need to also do server side validation as a back up? i usually always go with PHP as my validation just curious before i start coding. thanks guys Graham Quote Link to comment https://forums.phpfreaks.com/topic/87898-solved-form-validation-question/ Share on other sites More sharing options...
monkeytooth Posted January 26, 2008 Share Posted January 26, 2008 If your worried about java disabled end users PHP is your best bet then in my personal opinion at least. Only downside is PHP can't be ran on the fly like java so they would have to submit the form an go through a php validation page. And back to the form if necessary. But with the use of php you can mimic java in essence pending how you want to follow up with validation and errors there of within the form. Quote Link to comment https://forums.phpfreaks.com/topic/87898-solved-form-validation-question/#findComment-449730 Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 I prefer php validation over javascript anyhow. with javascript an end user may disable and alter the script. php they have no choice but go throught the validation process. Quote Link to comment https://forums.phpfreaks.com/topic/87898-solved-form-validation-question/#findComment-449731 Share on other sites More sharing options...
PHP Monkeh Posted January 26, 2008 Share Posted January 26, 2008 Do both I'd say. JavaScript can be quite nice for a user who isn't trying to be malicious, and then you'll always have the PHP checks to get the ones who're trying to be a pain. Quote Link to comment https://forums.phpfreaks.com/topic/87898-solved-form-validation-question/#findComment-449732 Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 There is no reason not to use both, as Monkeh sez the Javascript can make it easier for users following the rules, while the php will catch those that dun want to play by the rules. Quote Link to comment https://forums.phpfreaks.com/topic/87898-solved-form-validation-question/#findComment-449797 Share on other sites More sharing options...
graham23s Posted January 26, 2008 Author Share Posted January 26, 2008 thanks guys both it is. Graham Quote Link to comment https://forums.phpfreaks.com/topic/87898-solved-form-validation-question/#findComment-449877 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.