Working with POST/GET

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mdl
Forum Newbie
Posts: 3
Joined: Mon Feb 21, 2005 6:48 am
Location: Sweden

Working with POST/GET

Post 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 :)
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

use isset($_POST) to test whether any data has been posted. ;)
mdl
Forum Newbie
Posts: 3
Joined: Mon Feb 21, 2005 6:48 am
Location: Sweden

Thanks

Post by mdl »

Thank you for the info... :D
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Post Reply