adding variables to search
if i have a line such as:
HTML Code:
http://www.site.net/index.php?s=1
in my browser and i want to be able to click on another link in my website and end up with:
HTML Code:
http://www.site.net/index.php?s=1&t=2
what is the correct method to do this via an anchor tag?
i tried:
PHP Code:
<?php echo $PHP_SELF;?>?t=<?php echo $tnum;?>">
but as you will know that only returned:
HTML Code:
http://www.site.net/index.php?t=2
so what is the correct way? (without using cookies if possible)
many thanks for your help,
Re: adding variables to search
Im not sure what you asking, but here is how you add another variable:
PHP Code:
<?php echo $PHP_SELF; ?>?t=<?php echo $tnum; ?>&s=<?php echo $snum; ?>
Re: adding variables to search
what i mean is that
if my url is:
this:
Quote:
<?php echo $PHP_SELF; ?>
still = http://www.site.net/index.php
ie.
Quote:
<?php echo $PHP_SELF;?>?t=<?php echo $tnum;?>">
will just do:
but i want to add $t onto whatever the url is (and keep any other variables already there intact)
hope that makes sense,
Re: adding variables to search
Use the $_SERVER['QUERY_STRING'] variable.
Re: adding variables to search
Validate all variables in $_GET and then use the results to generate a new query string for the hyperlink.