Jump to content

Check if On Page


Warptweet

Recommended Posts

What code would I use to check if I'm on a page like...

if
http://www.warptweet.com/index.php
then
display this code blah blah blah

if
http://www.warptweet.com/flashportal.php
then
dispaly this code blah blah blah

if
http://www.warptweet.com/upload
then
display this code balh blah blah

So basically, check what page it's viewing?
Link to comment
https://forums.phpfreaks.com/topic/35067-check-if-on-page/
Share on other sites

An idea would be to store the value between your <title> and </title> tags into a variable and compare.  So you could have...

[code]if ($title == "Index")
  echo "You are at the main page.";
else if ($title == "Page 1")
  echo "You are at Page 1.";
[/code]
...and so forth.
Link to comment
https://forums.phpfreaks.com/topic/35067-check-if-on-page/#findComment-165494
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.