i have a question about formatting the URL parameters in php
page 1 can have these 2 url
http://somewhere.com/page1.php?foo=1
and
http://somewhere.com/page1.php
now on page 1, when i click a button, i want it to redirect to its self but with an additional parameters in the URL like so
http://somewhere.com/page1.php?foo=1&bar=2
or
http://somewhere.com/page1.php?bar=2
depending on the current url. How can i do this in php?
thanks,
Vidhu
First, check if a certain
$_GETparameter is set, usingisset.If it is,
echoa certain link. If not,echoa different link.