You are here: Re: dealing with incorrect input and moving back a page... « All PHP « IT news, forums, messages
Re: dealing with incorrect input and moving back a page...

Posted by Rik on 10/01/37 11:29

juglesh wrote:
> well, the easiest way, is on page b, just go 'hey that's an invalid
> email addy, use yer back button and fix it' The values that they typed
> should be there.

And for MSIE (that isn't behaving to correctly...) add the following after
session_start():
header("Cache-control: private");

That should repair the nast quality of IE "forgetting" everything in a just
submitted form.

> Or, you could have the page A submit to itself.
> if ($_POST['submit'] == 'submit'){
> //do your validation
> }
> if (($validation == 'error')OR($_POST['submit'] != 'submit'){
> //display the form
> // <input type='text' name='email' value='<?php echo $_POST['email']
>> '>
> }
> else{
> // do whatever, validation is passed
> }

I prefer the second option, saves a hell of a lot unneccesary different
files.

Grtz,

RIk

 

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

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