aussiefly Posted February 26, 2008 Share Posted February 26, 2008 hi guys, i'm putting together a little referrer script for my site and I was just wondering if there is some simply way to 'grab' the variables listed in a URL. So for instance if a client was sending people to www.somerandomURL.com?refer=101 is there a way that when a new member then registers i can grab that account no out of the URL and store it in a variable for later use?? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted February 26, 2008 Share Posted February 26, 2008 So you know the name of the variable in the URL? Just use the $_GET array: $refer = $_GET['refer']; Quote Link to comment Share on other sites More sharing options...
fnairb Posted February 26, 2008 Share Posted February 26, 2008 If you are trying to find out which variables are available you might try: $vars = array_keys($_GET); Though you may want to use $_REQUEST to include both GET and POST requests. You also have $_SERVER['QUERY_STRING'] which contains the, well, query string. Quote Link to comment Share on other sites More sharing options...
aussiefly Posted February 26, 2008 Author Share Posted February 26, 2008 awesome! That did the trick perfectly! Thanks for the help aussie Quote Link to comment 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.