Jump to content

[SOLVED] variable not always set so I recieve an error... :(


Dragen

Recommended Posts

Okay, I've got this extremly simple code:

$feed = $_GET['feed'];

The problem is there isn't always a feed variable to get when the page loads so I recieve a:

Notice: Undefined index: feed in /home/fhlinux172/t/test.gimppro.co.uk/user/htdocs/littleoaks/feedback.php on line 2

 

So every time I load the page it gives me this error... Is there any way of stopping this error if there is no feed variable to get using $_GET?

 

Thanks

you missed out the ; after $_GET['feed']..

but I still get the same message. The problem is I'm checking for 'feed' using get, but if there is no 'feed' sent, then I recieve the error telling me that it's looking for something that isn't there....

I've never had this problem on my usual server, but have just set up a new one that I use for testing scripts. I think it must have some different settings for warnings etc..

 

 

EDIT: utexas! thanks. the isset worked. Thanks.

hmm.. didn't realise I could do that.

To be honest though I didn't have a clue what half of it meant.

I've got it solved now though. Just needed to use isset!

 

EDIT: Thanks utexas. i thought it might be something to do with error reporting, but don't know much about it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.