Doug wrote:
I am trying to make something similar to citysearch.com. For example:
If you search for a city, say Raleigh, NC, it will find it for you,
but then all other URLs on the page will have the location parameter
attached. For example, say "city=raleigh" So, if you go back to the
home page, or any other page on the site, that will still be attached to
the URL. Is there any easy way to do that? I know PHP has a way to
automatically attach a session ID to every URL.
Is there a way I can attach a parameter of my own choosing automatically?
I don't think cookies will work in this situation. The problem with
cookies is that there is only one cookie with one location in it, where
the user may have several pages open for different locations.
what do you think?
Just a quick solution, write a little function like so:
<?php
function appendit() {
if(isset($_GET)) {
$message = '?';
foreach($_GET as $append_key => $append_val ) {
$message .= $append_key.'='.$append_val.'&';
}
}
return $message;
}
$urladdon = appendit();
echo '<a href="test.php'.$urladdon.'">Test Page</a>";
?>
Something like that should do the trick, there might be more automated
ways about, let the group know your findings.
Hope that helps,
Anthony.