PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
psurrena
Forum Contributor
Posts: 355 Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY
Post
by psurrena » Wed Jul 11, 2007 8:25 am
I want to use a different background image on certain pages. How do I detect the /greatpage.php? Basically what HTTP_REFER leaves out.
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Wed Jul 11, 2007 11:17 am
HTTP_REFERER shows the last page you browsed.
What about PHP_SELF or REQUEST_URI?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jul 11, 2007 3:00 pm
__FILE__ is probably better to use. It's certainly safer than PHP_SELF.
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Thu Jul 12, 2007 3:49 am
feyd wrote: __FILE__ is probably better to use. It's certainly safer than PHP_SELF.
Yes. But only if we don't use mod_rewrite.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Jul 12, 2007 6:51 am
Gente wrote: Yes. But only if we don't use mod_rewrite.
With mod_rewrite, one is on their own as they should be able to figure it out.