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
https://forums.phpfreaks.com/topic/68599-if-statement-with-array/
Share on other sites

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.