Jump to content

If Statement With Array


MrXander

Recommended Posts

Hi There,

 

I was wodnering if anyone can help me. I am currently developing a site that requires users to sign up. I completely forgot to add a piece of code to every page to see if the user is logged in. So what I want to do, is something like this:

 

Baring in mind, $c is defined earlier as $_GET['c'];

 

if ($cookie){

if ($c == "forums"){

echo "You are not logged in";

}

}

Something similar to that, but obviously I would need a list of like, 15-20 pages. Is there any way I can put all the page names in an array then check them in an IF statement?

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.