Get Full Path of Page

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
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Get Full Path of Page

Post by violet »

How do I get the full path of Page B, which has URL parameters generated by Page A (a PHP form with method = GET)?

$_GET only seems to work if one is getting variables from within the same page and include seems to include the entire page (which is not what I want)..
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Code: Select all

<pre><?php print_r($_SERVER);?></pre>
Run that. It'll show you.

Edit: Misread the question.

You have to pass get variables along from page to page if you want to keep them.
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Post by violet »

Ah, thanks, I will figure out how to do this :)

Love Image your site, by the way!
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

:D Thanks.

This is a good way to get all $_GET variables:

Code: Select all

$getVars = '?';
foreach($_GET as $id => $data)
{
    $getVars .= $id . '=' . $data . '&';
}
$getVars = substr($getVars, 0, (strlen($getVars) - 1));
Then, just concatenate them to the end of your URLs.
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Post by violet »

Everyone's been so helpful here. Thanks again!

By the way I see a:

/>

on the upper left side of your page.

I'm wondering if it's just my browser because Opera's weird sometimes..

My fave layout is 'YourCompany' ^_^ Spiffy!
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

violet wrote:Everyone's been so helpful here. Thanks again!

By the way I see a:

/>

on the upper left side of your page.

I'm wondering if it's just my browser because Opera's weird sometimes..

My fave layout is 'YourCompany' ^_^ Spiffy!
Yeah, due to monetary issues, I haven't touched the company site in a while. I've other projects that make my survival possible.
Post Reply