View Full Version : $_GET + MySQL [Visitors/Referred]
02-02-2010, 09:13 PM
OK. Pretty much I am looking for a tutorial on taking a variable in the browser, (EX: google.com?r=123) and adding 1 (Yes, like the number) to 123's referral count. If anyone can direct me on how to do that, that'd be wonderful :)
ALSO, is there a way where we can do it with a line of code simply like:
$referrals = ++;
Or something? So the user has to do something for it to go up?
02-02-2010, 09:17 PM
yes, you can use HTTP_REFERER:
then you'll need to parse the query string to get the data, at that point you should be able to increment the number like:
02-02-2010, 09:18 PM
It's as easy as $_GET['r']++. Now, if you want that new number to show up in the URL, you'll need to reload the page. You can do this with a header("Location:URL"), but you'll need to format the query string yourself. You can also use a form with method="GET", then use a hidden input element to handle the the new number.
02-02-2010, 09:30 PM
ah, thanks for the spam.......
( does this ever actually work? )
02-02-2010, 09:37 PM
We're now engaged.
02-02-2010, 09:38 PM
sweet! if only I had clicked sooner! ;)
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.