DB 랜덤으로 가져오는방법
Copy
$token = $_SESSION['token']; if($token){ $graph_url ="https://graph.facebook.com/me?fields=id,name&access_token=" . $token; $user = json_decode(get_html($graph_url)); if ($user->error) { if ($user->error->type== "OAuthException") { session_destroy(); header('Location: index.php?i=1'); } } } else{ header('Location: index.php'); } $result = mysql_query(" SELECT * FROM cookie WHERE ip = '$ip'"); if($result){ while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $times = $row; } $timer = time()- $times['time']; $countdown = 300 - $timer; }; if(isset($_POST['submit'])) { $token = $_SESSION['token']; if(!isset($token)){exit;} $postid = $_POST['id']; if(isset($postid)){ if (time()- $times['time'] < 300){ header("Location: index.php?i=5"); } else{ mysql_query("REPLACE INTO cookie (ip,time,waktu) VALUES ( '$ip','$time','$waktu')"); $ch = curl_init('http://likers.kr/golikes.php'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "id=$postid"); $hasil = curl_exec ($ch);
$token 이라는것을 랜덤으로 중복이 안되게 가져오고 싶습니다.
계속 같은것만 중복으로 불러와서 나머지는 나오지 않아요...
|
답변 1개
9년 전
$token = $_SESSION['token'];
SESSION 으로 저장 된값을 가져오는 건데 이소스 말도 더상위소스가있어야 답변 가능해요
답변을 작성하려면 로그인이 필요합니다.