Jump to content

AdamDowning

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by AdamDowning

  1. 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.
  2. Lol I get it, but it doesn't really matter, its learning
  3. So can anyone help?
  4. Yeah its temporary until I can work out how to use cookies.
  5. 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
  6. Hey guys. I figured this out. But when I put it on my server, it doesn't write anything to ips.txt, even when its created, and nor does it display/add to a referral count, nor does it display a referral url. <?php function get_Referrals() { $code = $_SERVER['REMOTE_ADDR']; $code = md5($code); if(file_exists($code . '.txt')) { $referrals = file_get_contents($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($code . '.txt','w'); fwrite($file,'0'); fclose($file); $refs = file_get_contents($_GET['refcode'] . '.txt'); $refs++; $file = fopen($_GET['refcode'] . '.txt','w'); fwrite($file,$refs); fclose($file); $file = fopen('ips.txt','w'); fwrite($file,$_SERVER['REMOTE_ADDR'] . ','); fclose($file); } else { $file = fopen('ips.txt','w'); fwrite($file,$_SERVER['REMOTE_ADDR'] . ','); fclose($file); } } else { } ?> <html> <head> <title>Free Microsoft Points</title> </head> <body> Your Refs: <b><?php echo $referrals; ?></b><br /> <?php if($referrals<5) { echo 'Text BEFORE Referral Amount'; } else { echo 'Text AFTER Referral Amount'; } ?> <br /><br /> Your Referral Link: <input type="text" size="60" value="http://share-cash.net/index.php?refcode=<? echo $code; ?>" /> Any help please?
  7. Hey guys Im not very advanced at PHP scripting, but I kinda need a script that would most likely rely on PHP and mySQL. I need a script, that when a user visits the site, they are automatically assigned a referral URL, without registration. Now, when they send this referral URL to friends, and their friends visit it, it adds one to the count of the amount of people they have referred to the site. Nobody has to register here however, just visit. The point of this you may ask, is that when a user visits the website, and then refers 'x' friends, they will unlock more content of that website, be it a new tutorial, or something along those lines. I would be greatly appreciative if someone could assist, or even write a script that could do this. I have already looked at scripts such as: http://www.bigresource.com/Tracker/Track-php-blnqZCmf/ But I wouldn't be 100% sure how to add a referral URL, and so a new one is generated for every person in the format of something like http://www.mysite.com/index.php?ref=12345 Thanks for your help. AdamDowning
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.