- Joined
- May 30, 2008
- Messages
- 558
- Reaction score
- 64
ok heres my script
I need know how to do rand($id1,$id2,$id3,$id4,$id5); and the time + 24hrs
oh yeah I want the ids to be like
520529 and like 123006, because there item id's
PHP:
<?php
session_start();
include'./connection/globals.php';
if($_SESSION['id']){
$sql = "SELECT * FROM timecard WHERE id='".$_SESSION['id']."'";
$res = mssql_query($sql);
$row = mssql_fetch_assoc($res);
if(time() > $row['next']){
if(!$_POST['random']){
echo "click to get random item<br>";
echo "<form action=\"?act=random\" method=\"POST\">";
echo "<br><input name=\"random\" type=\"submit\" value=\"Get Item\"><br>";
echo "</form>";
}else{
$id1 = "1";
$id2 = "2";
$id3 = "3";
$id4 = "4";
$id5 = "5";
$rand = rand($id1,$id5);
$sql2 = "INSERT INTO AccountItem (AID,ItemID) VALUES ('".$_SESSION['id']."','$rand')";
$res2 = mssql_query($sql2);
if($res2 == TRUE){
$itemsql = "SELECT * FROM Item WHERE ItemID ='$rand'";
$itemres = mssql_query($itemsql);
$item = mssql_fetch_assoc($itemres);
$next = time() + (24000);
$sql3 = "UPDATE timecard SET time='".time()."', next='$next' WHERE id='".$_SESSION['id']."'";
$res3 = mssql_query($sql3);
if($res3 == TRUE){
echo "Successfuly got the item : ".$item['Name']."";
}
}
}
}else{
echo "Please wait the full 24 hours to use this feature again!";
}
}else{
echo "<br><a href=\"./session.php\">Here to login</a><br>";
}
?>
I need know how to do rand($id1,$id2,$id3,$id4,$id5); and the time + 24hrs
oh yeah I want the ids to be like
520529 and like 123006, because there item id's

