sprinjee Posted June 4, 2006 Share Posted June 4, 2006 When doing echo $_SERVER['HTTP_REFERER'] I see the information:[a href=\"http://www.koenvissers.nl/survey/survey.php?uid=14482e0bec0181&linkcode=Ef0004\" target=\"_blank\"]http://www.koenvissers.nl/survey/survey.ph...linkcode=Ef0004[/a]How can I extract Ef0004 from $_SERVER['HTTP_REFERER']? Quote Link to comment https://forums.phpfreaks.com/topic/11177-variable-from-serverhttp_referer/ Share on other sites More sharing options...
.josh Posted June 4, 2006 Share Posted June 4, 2006 couple of useful linkies[a href=\"http://www.php.net/preg_match\" target=\"_blank\"]http://www.php.net/preg_match[/a][a href=\"http://www.php.net/regex\" target=\"_blank\"]http://www.php.net/regex[/a] Quote Link to comment https://forums.phpfreaks.com/topic/11177-variable-from-serverhttp_referer/#findComment-41806 Share on other sites More sharing options...
sprinjee Posted June 4, 2006 Author Share Posted June 4, 2006 thx...Solved it:$lnkcod = str_replace("http://www.koenvissers.nl/survey/survey.php?uid=14482e0bec0181&linkcode=", "" , $_SERVER['HTTP_REFERER']); Quote Link to comment https://forums.phpfreaks.com/topic/11177-variable-from-serverhttp_referer/#findComment-41820 Share on other sites More sharing options...
poirot Posted June 4, 2006 Share Posted June 4, 2006 This is not going to work if there are any small differences in the URL.You should use true regex. If you tell me what you expect linkcode to be (what is it's length? alphanumeric only? is it always in the end of the URL) I can give you a regular expression... Quote Link to comment https://forums.phpfreaks.com/topic/11177-variable-from-serverhttp_referer/#findComment-41830 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.