Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // MySQL connection
- $host = "localhost";
- $user = "*****";
- $pass = "******";
- $data = "****";
- $connection = mysql_connect($host,$user,$pass)
- or die("Could not connect: ".mysql_error());
- mysql_select_db($data,$connection)
- or die("Error in selecting the database:".mysql_error());
- $Query1 = mysql_Query("SELECT * FROM catalog_items WHERE daily_gift = '1' ORDER BY RAND() LIMIT 1");
- IF($gift = mysql_fetch_array($Query1)){
- $user = mysql_real_escape_string($gift['user_id']);
- $item = mysql_real_escape_string($gift['item_id']);
- $name = mysql_real_escape_string($gift['catalog_name']);
- $sql1 = mysql_Query("INSERT INTO `items` (user_id, base_item) VALUES ('".$_SESSION['user']['id']."', '"$gift['item_id']"')") or die(mysql_error());
- echo "<div style='padding:10px;background-color:green;border-radius:3px;font-family:arial;font-size:12px;color:#FFF;text-align:center;'>You have been given a <b>" . $name . "</b>!</div>";
- }
- sleep(86400);
- if (sleep = 0)
- echo 'Reload this page'
- else (
- echo 'You must wait till tomorrow to open another gift'
- }
- exit();
- else {
- }
- ?>
- </div>
- </div>
- </div>
- <?php include "templates/footer.php"; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement