vendredi 28 août 2015

Is there a way to see if a certain page is visited with $_SERVER?

I'm currently working on a simple CMS for my blog where you can look on the user, modify and create new posts, check on the main page to see how it all looks like and have a logout/login button that actually works.

And here's the case. All the button works, I did found my way to insert a admin menu into a main page that pop up only when you're logged in. But I don't want to the "Main Page" button shows up when you actually are on the main page for obvious reasons, and I want to do it in menu file which is .php.

The way I thought would be efficient was

    <?php
if ($_SERVER['PHP_SELF'] !== 'blog_dm/index.php')
echo "<li id='blog-menu'><a href="blog_dm/index.php" target="_blank">Zobacz strone</a></li>"?>

But it show pop up an error massage

Parse error: syntax error, unexpected 'blog_dm' (T_STRING), expecting ',' or ';

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire