Jump to content

Why isnt isset working? Whats wrong with this?


xFalseProphet
Go to solution Solved by trq,

Recommended Posts

Hello! This may sound like a stupid question but i have been trying to get this working all day and its driving me crazy.

 

Ive been asked to take over development of this project, he sent me his code and its a little out of date so im trying to update it. Here is what i cant work out.

 

I have this little snippet of code:

if ($page == "showthread"){
	showThread();
} 

There are several more like that, but you dont need a whole list.

 

That code seems to be throwing up this error when i go to that specific page:

Notice: Undefined index: error in .....

 

All well and good, i would usually do this:

if (isset($page) == "showthread"){
	showThread();
} 

Thats fine and dandy, the error goes away. But now, when i go to that page, it redirects me and gives me my error message for a non-existing page.

 

Its really frustrating me. Can you help me fix this little error?

Link to comment
Share on other sites

isset returns a boolean true or false, so its result will never equal the string "showthread".

 

On top of that, I fail to see how that could possibly have fixed your error. Can you post the original and complete error message?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.