soulscriber Posted May 6, 2007 Share Posted May 6, 2007 Hi, I have php code that strips the search engine's referring keyword out of the referring url above the html code. so, loading http://www.mydomain.com/pages.php generates the variable $keywords that contains the referring keyword, right before the html is loaded. I would like to see if I can get code to take $keywords and instantly append them to the url. so, when someone visits http://www.mydomain.com/pages.php having searched for 'widgets' in the search engine, I want the url to say 'http://www.mydomain.com/pages.php?widgets', or something along those lines. Is this possible? Thanks. Link to comment https://forums.phpfreaks.com/topic/50295-adding-variable-to-the-url-on-the-same-page/ Share on other sites More sharing options...
papaface Posted May 6, 2007 Share Posted May 6, 2007 I suppose you could use: index.php $keywords = "something"; header('Location: index.php?key='.$keywords.''); This would redirect the browser to the same page, but with the added ?key= part. Link to comment https://forums.phpfreaks.com/topic/50295-adding-variable-to-the-url-on-the-same-page/#findComment-246890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.