Help with _SERVER["xxx"] vars

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

Post Reply
future_man
Forum Newbie
Posts: 8
Joined: Wed Jun 25, 2003 6:08 pm

Help with _SERVER["xxx"] vars

Post by future_man »

Hello,

I'm trying to find a way to extract the original querystring (admin.issuesIndex) from a page's url, rather than the one being appended to it once the page is reloaded (?from=25) in the example below.

http://www.website.com/index.php/admin. ... ex?from=25

I've tried $_SERVER['PHP_SELF'] but it returns: index.php

While $_SERVER["REQUEST_URI"] returns: ?from=25

I need to return: admin.issuesIndex.htm

Is there an easy way to do this?

Thanks,
John
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

You should use $_SERVER['PATH_TRANSLATED']:

Code: Select all

$your_page = strrchr($_SERVER['PATH_TRANSLATED'], "/");
future_man
Forum Newbie
Posts: 8
Joined: Wed Jun 25, 2003 6:08 pm

Thanks!

Post by future_man »

Thanks Delorian!
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

You're welcome!
Post Reply