943,020 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 990
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Jul 13th, 2010
0

PHP Form Validation Tutorials

Expand Post »
I need to create a form validation system where the user will be returned to the form with the valid data still in the form and the bad data barked for correction.

Can anyone point me to a good tutorial for that sort of thing?
Similar Threads
Reputation Points: 10
Solved Threads: 6
Junior Poster in Training
scaiferw is offline Offline
78 posts
since May 2010
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
Check the contact form in my cv website>> anas-tawfeek.co.cc
and try to type fake email and fake security number...if u want something like this i will post the full code for u. and the files.
Reputation Points: 9
Solved Threads: 0
Light Poster
DarkBerzerk™ is offline Offline
34 posts
since Jul 2010
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
Here's one way to do it:
PHP Syntax (Toggle Plain Text)
  1. <?php
  2. if($_POST) {
  3.  
  4. // create short variable names
  5. $name = htmlentities(trim($_POST['name']));
  6. $email = htmlentities(trim($_POST['email']));
  7.  
  8. // process form
  9. } else {
  10.  
  11. // create short variable names
  12. // they should have the same names as the ones created above
  13. $name = NULL;
  14. $email = NULL;
  15. }
  16.  
  17. // begin page
  18. ?>
  19. <html>
  20. <head></head>
  21. <body>
  22. <form ...>
  23. <input type="text" name="name" id="name" value="<?=$name?>" />
  24. <input type="text" name="name" id="name" value="<?=$email?>" />
  25. </form>
  26. </body>
  27. </html>

Hope that helps!
- EF
Reputation Points: 40
Solved Threads: 31
Junior Poster
EvolutionFallen is offline Offline
198 posts
since Aug 2009
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
i guess he want validation system...means if u typed wrong E-mail for ex. the page reload and make the E-Mail word with Red to type it agine.
Reputation Points: 9
Solved Threads: 0
Light Poster
DarkBerzerk™ is offline Offline
34 posts
since Jul 2010
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
Yes, but there are plenty of PHP form validation tutorials out there, plus you already offered him your code. I was simply providing a method to solve his request that "the user will be returned to the form with the valid data still in the form."
Reputation Points: 40
Solved Threads: 31
Junior Poster
EvolutionFallen is offline Offline
198 posts
since Aug 2009
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
ahaa...got it...
BTW the form i have do that .. i posted the full codes and attached the needed files...check the last posts
Last edited by DarkBerzerk™; Jul 13th, 2010 at 12:50 pm.
Reputation Points: 9
Solved Threads: 0
Light Poster
DarkBerzerk™ is offline Offline
34 posts
since Jul 2010
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
Check the contact form in my cv website>> anas-tawfeek.co.cc
and try to type fake email and fake security number...if u want something like this i will post the full code for u. and the files.
It looks like your form has just what I'm looking for.

Would be very grateful if you'd post the code.

Cheers.
Reputation Points: 10
Solved Threads: 6
Junior Poster in Training
scaiferw is offline Offline
78 posts
since May 2010
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
Already Posted It the three files codes and the ttf file (that use in the security image)...dont copy all the codes and cr8 files...coz i already uploaded them all in the end
Reputation Points: 9
Solved Threads: 0
Light Poster
DarkBerzerk™ is offline Offline
34 posts
since Jul 2010
Jul 13th, 2010
0
Re: PHP Form Validation Tutorials
BTW the post name is "Amazing Contact Form With Validation And Security Image."
Reputation Points: 9
Solved Threads: 0
Light Poster
DarkBerzerk™ is offline Offline
34 posts
since Jul 2010
Jul 14th, 2010
0
Re: PHP Form Validation Tutorials
there is complete validation for PHP form submiting.
i found following link
http://www.scriptsocean.wordpress.com
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kk_pbr is offline Offline
7 posts
since Jul 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Update the data
Next Thread in PHP Forum Timeline: Emailing an attached file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC