DB 랜덤으로 가져오는방법
본문
$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 이라는것을 랜덤으로 중복이 안되게 가져오고 싶습니다.
계속 같은것만 중복으로 불러와서 나머지는 나오지 않아요...
!-->
답변을 작성하시기 전에 로그인 해주세요.