Page 1 of 1

Working with POST/GET

Posted: Mon Feb 21, 2005 6:55 am
by mdl
Hello!

I have not been working with PHP very long, and there is one thing I havn't found any information about. Please share your ideas and knowledge on this issue...

I have a php-page which is (and should always) be called with, lets say 10 params. (I use POST method to enclose these params).

Now, I have a minor problem, if I (Or someone else) tries to enter my page directly by typing http://www.myadress.com/myphp_page.php no params will be avalible and the php-script engine will put out alot of NOTICE undefined index PARAM1 in 'http://www....' on Line X

How do I do to avoid this to happening. is there any way to check from the script if or if not a index in the $_POST[] array exists? Then my problem would be solved :)

Posted: Mon Feb 21, 2005 7:19 am
by n00b Saibot
use isset($_POST) to test whether any data has been posted. ;)

Thanks

Posted: Mon Feb 21, 2005 7:46 am
by mdl
Thank you for the info... :D

Posted: Mon Feb 21, 2005 7:49 am
by patrikG