Help - Search - Member List - Calendar
Full Version: more than $_SERVER['PHP_SELF'] what could i use?
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Jim S.
i have a page that have many variable attached to it, like:
www.mysite.com/default.php?v=1

now "v" can change to many values depends on the link on the site, now here
is what i want, i want to pass a variable , let us say "b", and i want to
assigne that variable b some values, but i want what ever in the address
bar, like:
www.mysite.com/default.php?v=1&c=2 or whatever to stay the same than, i want
to append the "b" and it's value to the string, so it gets to be like :
www.mysite.com/default.php?v=1&b=3

is there a php function that can take the URL in the address (with the
values added) and append whatever to it?
i know there is a $_SERVER['PHP_SELF'] but it does take the URL without the
added variables. help please
thanks
Jim

Oli Filth
Jim S. said the following on 09/06/2005 23:18:
QUOTE

is there a php function that can take the URL in the address (with the
values added) and append whatever to it?
i know there is a $_SERVER['PHP_SELF'] but it does take the URL without the
added variables. help please

$_SERVER['REQUEST_URI']

--
Oli

Jeroen Maathuis
Oli Filth wrote:

QUOTE
Jim S. said the following on 09/06/2005 23:18:

is there a php function that can take the URL in the address (with the
values added) and append whatever to it?
i know there is a $_SERVER['PHP_SELF'] but it does take the URL without the
added variables. help please

$_SERVER['REQUEST_URI']


Or use the $_GET array:


<?php
foreach ($_GET as $key => $value) {
echo "Key: $key; Value: $value<br />n";
}
?>

Pretty simple actually.

Jeroen Maathuis
Oli Filth wrote:

QUOTE
Jim S. said the following on 09/06/2005 23:18:

is there a php function that can take the URL in the address (with the
values added) and append whatever to it?
i know there is a $_SERVER['PHP_SELF'] but it does take the URL without the
added variables. help please

$_SERVER['REQUEST_URI']


Or use the $_GET array:


<?php
foreach ($_GET as $key => $value) {
echo "Key: $key; Value: $value<br />n";
}
?>

Pretty simple actually.

Oli Filth
Jeroen Maathuis said the following on 11/06/2005 00:15:
QUOTE
Oli Filth wrote:


Jim S. said the following on 09/06/2005 23:18:

is there a php function that can take the URL in the address (with the
values added) and append whatever to it?
i know there is a $_SERVER['PHP_SELF'] but it does take the URL without the
added variables. help please

$_SERVER['REQUEST_URI']



Or use the $_GET array:

<?php
foreach ($_GET as $key => $value) {
echo "Key: $key; Value: $value<br />n";
}
?

Pretty simple actually.

Yeah, that sounds a hell of a lot simpler than $_SERVER['REQUEST_URI']!!!!

--
Oli

Jim S.
well guys, thank u very very much,, i have not tried that solution yet, but
i hope if i have problmes for u to check back since i may know a little
about php, but i still struggle :(
please check back, don't leave me :( :)
again guys thanks a bunch
Jim

"Jim S." <[Email Removed]> wrote in message
news:Me3qe.1842$[Email Removed]...
QUOTE
i have a page that have many variable attached to it, like:
www.mysite.com/default.php?v=1

now "v" can change to many values depends on the link on the site, now
here
is what i want, i want to pass a variable , let us say "b", and i want to
assigne that variable b some values, but i want what ever in the address
bar, like:
www.mysite.com/default.php?v=1&c=2 or whatever to stay the same than, i
want
to append the "b" and it's value to the string, so it gets to be like :
www.mysite.com/default.php?v=1&b=3

is there a php function that can take the URL in the address (with the
values added) and append whatever to it?
i know there is a $_SERVER['PHP_SELF'] but it does take the URL without
the
added variables. help please
thanks
Jim




PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.