AdamDowning Posted June 7, 2010 Share Posted June 7, 2010 Hey Guys Just seeking a little help with this script. I have created it, and now I want to make it so that when the person has 5 referrals, it changes over a part of the script to link to another website <?php $code = $_SERVER['REMOTE_ADDR']; $code = md5($code); if(file_exists('referrals/' . $code . '.txt')) { $referrals = file_get_contents('referrals/' . $code . '.txt'); } else { $referrals = 0; } $ips = file_get_contents('ips.txt'); $ips = explode(',',$ips); if(!in_array($_SERVER['REMOTE_ADDR'],$ips)) { if(isset($_GET['refcode'])) { $file = fopen('referrals/' . $code . '.txt','w'); fwrite($file,'0'); fclose($file); @$refs = file_get_contents('referrals/' . $_GET['refcode'] . '.txt'); $refs++; $file = fopen('referrals/' . $_GET['refcode'] . '.txt','w'); fwrite($file,$refs); fclose($file); $file = fopen('ips.txt','a'); fwrite($file,$_SERVER['REMOTE_ADDR'] . ','); fclose($file); } else { $file = fopen('ips.txt','a'); fwrite($file,$_SERVER['REMOTE_ADDR'] . ','); fclose($file); } } else { } ?> [/code] <div class="pack"> <a href="javascript:alert('You need <? $var = 5-$referrals; echo $var; ?> more referrals to unlock 1600 Microsoft Points.');" alt="1,600 Points">5 Referals!<br/> <img src="pack1.gif" border="0" alt="1,600 Points" /> </a> <br/> <span>US, UK & EU</span> </div> <div class="spacer"></div> <div class="pack"> <a href="javascript:alert('You need <? $var2 = 10-$referrals; echo $var2; ?> more referrals to unlock 2100 Microsoft Points.');" alt="2,100 Points">10 Referals!<br/> <img src="pack2.gif" border="0" alt="2,100 Points" /> </a> <br/> <span>UK & EU</span> </div> <div class="spacer"></div> <div class="pack"> <a href="javascript:alert('You need <? $var3 = 15-$referrals; echo $var3; ?> more referrals to unlock 4200 Microsoft Points.');" alt="4,200 Points">15 Referals!<br/> <img src="pack3.gif" border="0" alt="4,200 Points" /> </a> <br/> <span>US, UK & EU</span> </div> </div> [/code] Now code ONE is my PHP script, this makes the referral count work. I have also made the HTML/JS code work so that it counts down how many referrals a person needs to obtain before unlocking the content. But, I want to make the HTML code so that when they have say, 5 referrals, and they click the image, it changes from <a href="javascript:alert('You need <? $var = 5-$referrals; echo $var; ?> more referrals to unlock 1600 Microsoft Points.');" alt="1,600 Points">5 Referals!<br/> to the code bwloe <a href="http://www.website.com" alt="1,600 Points>5 Referrals!<br/> Can anybody assist me with how I would do this please? Thanks Quote Link to comment Share on other sites More sharing options...
ignace Posted June 7, 2010 Share Posted June 7, 2010 IP's like in my country change daily, so that would mean I wouldn't even have to bother participating in your game. As I would always start from 0 Quote Link to comment Share on other sites More sharing options...
AdamDowning Posted June 7, 2010 Author Share Posted June 7, 2010 Yeah its temporary until I can work out how to use cookies. Quote Link to comment Share on other sites More sharing options...
AdamDowning Posted June 7, 2010 Author Share Posted June 7, 2010 So can anyone help? Quote Link to comment Share on other sites More sharing options...
ignace Posted June 7, 2010 Share Posted June 7, 2010 If someone is able to re-produce the cookie, they can perform an identity theft. Quote Link to comment Share on other sites More sharing options...
AdamDowning Posted June 7, 2010 Author Share Posted June 7, 2010 Lol I get it, but it doesn't really matter, its learning Quote Link to comment Share on other sites More sharing options...
GoneNowBye Posted June 7, 2010 Share Posted June 7, 2010 i'm willing to act as a PHP mentor if you like - PM me Quote Link to comment Share on other sites More sharing options...
aeroswat Posted June 7, 2010 Share Posted June 7, 2010 If someone is able to re-produce the cookie, they can perform an identity theft. To be honest bro I don't think that he even cares. It looks like this is one of those scam sites with an intelligent twist. To earn the microsoft points you have to refer others to the site so instead of stealing 1 person's account you have stolen their account and all of their friends. I refuse to help people like this Quote Link to comment Share on other sites More sharing options...
AdamDowning Posted June 7, 2010 Author Share Posted June 7, 2010 Erm, i'm not stealing anyones accounts, its for use with CPALead... and it will be turned into a competition, but to gain an entry, you refer 5 friends for each entry you want. 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.