Reply to dealing with incorrect input and moving back a page...

Your name:

Reply:


Posted by Domestos on 10/01/97 11:29

Say a user inputs an invalid string into a field - say for example e-mail in
a form on Page A...

Validation is done on Page B. It notices that the e-mail is incorrect and
informs the user and jumps them back to the form on Page A.

To get the values the user had input in the e-mail and other fields on the
form to re-display rather than a blank form I do the following...

On Page B I set $_SESSION('back')=1 and set other variables like
$_SESSION('name')=$name and $_SESSION('email')=$email

on returning to PageA I check if $_SESSION('back') exists and if so set the
$name and $email to the $_SESSION superglobals, if not I read the
information in from a database. I then un-register $_SESSION('back') and the
others...

There must be a better way to do this!!!!

Can anyone advise please? or point me to some text...

I dont want to get into Classes and OO stuff just yet - unless it is the
only way!

--
Thanks,
Andrew Makinson
www.buy-a-pixel.com

[Back to original 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

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