Bruno Santos wrote:

Im developing a couple of pages and i need to do some redirecting to another page depending
on the choice of a user.
The problem is, to go to another page, i need to send some parameters in the URL that are alredy present, but i need to make the redirecting independent of the page. if i use $_SERVER['PHP_SELF'], i have only http://some_domain/the_page
and what i want is http://some_domain/the_page?some_parameters=value&another_parameter=value
the ?some_parameters=value are alredy present and i need to redirect them again...


I know that are some fuctions to manage this, or not...
any solucion ??

How about $_SERVER['QUERY_STRING']?

That _should_ contain the current query string with the values still encoded, but I'm not sure on that. If they aren't still encoded, then just rebuild the query string by looping through $_GET.

$url = $_SERVER['PHP_SELF'] . '?';
foreach($_GET as $key => $value)
{ $url .= '&' . $key . '=' . urlencode($value); }

If you have arrays within $_GET, then you'll need a recursive function, but hopefully one of the above will work for your needs.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to