PHP: Form Validation

Thread Solved

Join Date: Sep 2006
Posts: 14
Reputation: krea2r is an unknown quantity at this point 
Solved Threads: 0
krea2r krea2r is offline Offline
Newbie Poster

PHP: Form Validation

 
0
  #1
Oct 3rd, 2006
Hey there all. I wanted to know if there was a way to use php to validate form.

Well in more detail, I wanted to know if it was possible to print a msgbox using php telling the user he has missed some thing rather than having to display a new page. Also I don't want to use javascript if possible. Would like to thank in advance.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: PHP: Form Validation

 
0
  #2
Oct 3rd, 2006
Of course there is. This is basic PHP. Have you tried to write code for this yet?
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 204
Reputation: pcschrottie is an unknown quantity at this point 
Solved Threads: 8
pcschrottie's Avatar
pcschrottie pcschrottie is offline Offline
Posting Whiz in Training

Re: PHP: Form Validation

 
0
  #3
Oct 3rd, 2006
Hi,

Whats so bad in displaying the form again? If a input field is empty, you just give it a value like value="Please fill out this field". I think most sites do it like that, and message boxes without JavaScript are hardly possible.


Michael
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 44
Reputation: MCP is an unknown quantity at this point 
Solved Threads: 3
MCP MCP is offline Offline
Light Poster

Re: PHP: Form Validation

 
0
  #4
Oct 3rd, 2006
If you wanted to use php functions to do the validation (say against database entries and such), then you might want to consider using an ajax library such as xajax, and make it look spiffy using something like scriptaculous (ok, maybe I'm going overboard, but it can be very slick). I've used that to validate form fields against a database, and point out where issues might exist.

But, you can't really get away from javascript, if you don't want the page to reload. PHP is a server side language, meaning that once the form is rendered and sent to the browser, there's NO link with the server again until you submit back (or use ajax like stuff).

Personally, I prefer just doing client-side javascript validation, as its easier to point out to the user where errors lie. That's not to say that you don't need to revalidate once you hit php, as the javascript side is easily forgeable.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 14
Reputation: krea2r is an unknown quantity at this point 
Solved Threads: 0
krea2r krea2r is offline Offline
Newbie Poster

Re: PHP: Form Validation

 
0
  #5
Oct 10th, 2006
Thanks a lot guys for your help. I think i will stick with the form being reshown for the moment till i get a little more grisps with this php. THANKS A LOT AGAIN.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1
Reputation: er.amitkatoch is an unknown quantity at this point 
Solved Threads: 0
er.amitkatoch er.amitkatoch is offline Offline
Newbie Poster

Re: PHP: Form Validation

 
0
  #6
Oct 25th, 2007
I wanted to know if there was a way to use php to validate form.

Well in more detail, I wanted to know if it was possible to print a msgbox using php telling the user he has missed some thing rather than having to display a new page. Also I don't want to use javascript if possible.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 2
Reputation: vinothkumar023 is an unknown quantity at this point 
Solved Threads: 0
vinothkumar023 vinothkumar023 is offline Offline
Newbie Poster

Re: PHP: Form Validation

 
0
  #7
Jul 28th, 2009
Originally Posted by krea2r View Post
Hey there all. I wanted to know if there was a way to use php to validate form.

Well in more detail, I wanted to know if it was possible to print a msgbox using php telling the user he has missed some thing rather than having to display a new page. Also I don't want to use javascript if possible. Would like to thank in advance.
I wanted to know if it was possible to print a msgbox using phpvalidation must be in php
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC