You are here: Re: Best approach for server side Form Validation ? « PHP Programming Language « IT news, forums, messages
Re: Best approach for server side Form Validation ?

Posted by Rik on 06/24/06 16:58

h7qvnk7q001@sneakemail.com wrote:
> I'm trying to implement a simple server-side form validation (No
> Javascript). If the user submits a form with errors, I want to
> redisplay the same form with the errors highlighted. Once the form is
> correct I need to submit to another page that uses the form data.

I assume the redisplaying & highlighting errors is not the problem?

> I first tried making the form submit action= field point to the same
> file. When the form was correct, I tried loading the next page by
> using <META http-equiv refresh>. But that doesn't post the data, so
> the next page didn't have access to it.

In rederecting POST data is indeed lost.
There are several solution:
1. Use the same file for processing the data. (if it's a light application
it's the easiest one).
2. Use a temporary table in which you store the valid post data, preferably
with some auto_incremented key, which you can use as a GET variable on the
redirect (major security leak: other visitors can see what the rest is
doing).
3. Use sessions, and store the valid posted data into the $_SESSION, use
those values in the processing on the other page.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация