dark 0 Report post Posted January 5, 2005 HiDo you validate your forms using PHP , javascript or both?I was just playing around with a tutorial for a very simple guestbook and the creator did use both javascript and php to validate.ThanksPatrick Share this post Link to post Share on other sites
FaLgoR 0 Report post Posted January 6, 2005 validate the forms? I did not understand, but I use PHP:for <input name="name">:if(!$name){print "You can't let the input "name" in blank.";exit;}for long forms:if(!$name || !$email || !$age){print "You can't let any input in blank.";exit;} Share this post Link to post Share on other sites
LuciferStar 0 Report post Posted January 7, 2005 Hi Do you validate your forms using PHP , javascript or both? I was just playing around with a tutorial for a very simple guestbook and the creator did use both javascript and php to validate. Thanks Patrick <{POST_SNAPBACK}> I'd prefer using both of them.the form data needn't to be send by using javascript Share this post Link to post Share on other sites
no9t9 0 Report post Posted January 7, 2005 if php is available, it is the best method to evaluate forms. This is because some people have javascript disabled. If you use javascript, your form will not work in this case. Using php means the server does the work.Plus, php is very simple. Just a bunch of IF statements and you are done. All my forms are done in php and I don't even have to use a seperate file. Just need an IF (!submit) {display form} ELSE {validate form} Share this post Link to post Share on other sites