Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //-----------------Database values------------------------------
- $databasehost = "localhost";
- $databaseuser = "topic_topic";
- $databasepass = "taktak";
- $database = "topic_12";
- $databasetable = "topic";
- //--------------------------------------------------------------
- //---------------Instructional Text----------------------------
- //This is in html.
- $howitworks = "<p>
- <b>How can we give away tons of free Microsoft Points, or XBOX Live?</b><br/>
- You invite your friends. See the number on the locks? Invite that<br/>
- number of friends to unlock the prize. Copy the link inside the textbox,<br/>
- post it on your Facebook, Twitter, Youtube, anywhere. <br/>
- We get money from visitors. You get Free Xbox Live Stuff. <br/><br/>
- We all win. Have fun, and see you on Live.
- </p>
- </div>";
- //If you are using CSS, use this. Otherwise, comment this out.
- $divtag = "<div id=\"howitworks\">";
- //-------------------------------------------------------------
- $ipaddr = $_SERVER["REMOTE_ADDR"];
- $referral = $_GET["id"];
- $newvisitor = False;
- $yourid = -1;
- $yourvisitors = 0;
- $db = mysql_connect($databasehost, $databaseuser, $databasepass);
- $selected = mysql_select_db($databasetable) or die("Unable to connect");
- $query = "SELECT * from ".$databasetable." WHERE ip = '$ipaddr'";
- $result = mysql_query($query);
- $returned_rows = mysql_num_rows($result);
- if($returned_rows == 0)
- {
- $insertquery = "INSERT INTO ".$databasetable." (ip) VALUES ('$ipaddr')";
- mysql_query($insertquery);
- $result = mysql_query($query);
- $newvisitor = True;
- }
- $row = mysql_fetch_array($result);
- $yourvisitors = intval($row["visits"]);
- $yourid = intval($row["id"]);
- if(isset($referral))
- {
- $refquery = "SELECT * from ".$databasetable." WHERE id = '$referral'";
- $refresult = mysql_query($refquery);
- $returned_rows = mysql_num_rows($refresult);
- if($returned_rows == 0)
- {
- }
- else
- {
- $row = mysql_fetch_array($refresult);
- if($row["ip"] != $ipaddr && $row["lastip"] != $ipaddr && $newvisitor == True)
- {
- $visitors = intval($row["visits"]);
- $newvisitors = $visitors + 1;
- $updatequery = "UPDATE ".$databasetable." SET visits = '$newvisitors', lastip = '$ipaddr' WHERE id = '$referral'";
- mysql_query($updatequery);
- }
- }
- }
- mysql_close($db);
- //-----------EDIT LINKS TO IMAGES BELOW--------------
- //These 4 should be the "LOCKED" images.
- $image1 = "51600ptsLocked.png";
- $image2 = "104200ptsLocked.png";
- $image3 = "1512moliveLocked.png";
- $image4 = "25blackopsLocked.png";
- //These 4 are the links of the "LOCKED" images
- $link1 = "/index.html";
- $link2 = "/index.html";
- $link3 = "/index.html";
- $link4 = "/index.html";
- //Change the numbers (in the if-statements) to how many visitors you need.
- //Change the images to the "UNLOCKED" images.
- //Change the links to the redemption link
- if($yourvisitors >= 5)
- {
- $image1 = "UN-"."$image1";
- $link1 = "/redeem.php?p=1&c=46813";
- }
- if($yourvisitors >= 10)
- {
- $image2 = "UN-"."$image2";
- $link2 = "/redeem.php?p=2&v=94653";
- }
- if($yourvisitors >= 15)
- {
- $image3 = "UN-"."$image3";
- $link3 = "/redeem.php?p=3&x=16579";
- }
- if($yourvisitors >= 25)
- {
- $image4 = "UN-"."$image4";
- $link4 = "/redeem.php?p=4&q=84621";
- }
- //---------------------------------------------------
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement