You are here: Re: Passing hidden form fields « All PHP « IT news, forums, messages
Re: Passing hidden form fields

Posted by J.O. Aho on 12/16/05 02:10

Sam wrote:
> I'm using forms to pass variables between, for example, Page1 and
> Page2.
>
> This all works fine. However, if I open Page2 directly without first
> entering data in the form on Page1, I get an error similar to this:
>
> Notice: Undefined index: pc in
> content/Host/e/b/<bbbb>.com/web/thanks.php on line 223
>
> What's the best way to approach this so that the user doesn't see such
> an ugly message if they end up on Page2 without first going to Page 1?

You check if the variable is set with isset(), if it's not set, then don't
execute the line

eg:

isset($index) {
echo $index;
}


//Aho

 

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

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