Ell20 Posted January 5, 2008 Share Posted January 5, 2008 Hi, My friend has a website which gives bonuses to players who vote for the site on a voting site. However at the monent all the user has to do is click the link to open the window in a new window and they recieve the bonus. Is there anyway in which he can determine or not whether the actual vote button was pressed, if it was then give the bonus, otherwise dont give any bonuses until its actually been pressed? Thanks for your help. Elliot Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/ Share on other sites More sharing options...
Northern Flame Posted January 5, 2008 Share Posted January 5, 2008 hmmm... can i see the voting website? because you might be able to just create a script on your friends website and then when the user activates that script, you mark down that he voted and u use cURL() to submit the info. Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-430917 Share on other sites More sharing options...
Ell20 Posted January 5, 2008 Author Share Posted January 5, 2008 Hey, There are 6 voting sites but they all work in a very simular way. This is the main one: http://www.mmorpgtoplist.com/in.php?site=7776 This is the link which is given to the users which takes them straight to voting for his site, however at the moment he has no way of determining whether or not the actual vote button is pressed. Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-430919 Share on other sites More sharing options...
Northern Flame Posted January 5, 2008 Share Posted January 5, 2008 try something like this on your friends website: <a href="/curl.php">CLICK HERE TO VOTE FOR OUR WEBSITE</a> curl.php <?php // MARK DOWN THAT THIS USER VOTED 4 UR SITE // SUBMIT VOTE function Post($vars,$url){ $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,1); #curl_setopt($ch,CURLOPT_UPLOAD,1); curl_setopt($ch,CURLOPT_POSTFIELDS,$vars); curl_exec($ch); curl_close($ch); } $submit = 'Vote for Street Crime - Modern Crime RPG'; $url = "http://www.mmorpgtoplist.com/in.php"; $vars = "site=7776&submit=$submit"; Post($vars,$url); ?> im not sure if they'll count the vote, it depends on the info on their in.php file Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-430936 Share on other sites More sharing options...
Ell20 Posted January 5, 2008 Author Share Posted January 5, 2008 Hi, Just got round to trying it and I got the following error: Fatal error: Call to undefined function: curl_init() in /home/scrpgco/public_html/curl.php on line 8 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-431143 Share on other sites More sharing options...
Ken2k7 Posted January 5, 2008 Share Posted January 5, 2008 Try a more simpler method. When clicking a vote button, set a cookie that would expire in say a few hours. That should give plenty of time for them to click the bonus button. Of course the bonus button, upon click, needs to check if the cookie is set. If the cookie is set, delete it and give the person the credit. Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-431235 Share on other sites More sharing options...
Ell20 Posted January 5, 2008 Author Share Posted January 5, 2008 Thanks for your help but I would have no idea where to start with that. Elliot Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-431364 Share on other sites More sharing options...
john010117 Posted January 5, 2008 Share Posted January 5, 2008 setcookie() And do a simple if/else statement to see if the cookie is set. Quote Link to comment https://forums.phpfreaks.com/topic/84569-help-external-link/#findComment-431365 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.