쿼리 제출을 두 번 방지하기 위해이 코드 부분을 사용했습니다! 이제는 이것이 작동하도록하기 위해 사용하는 쿼리이며 작동합니다.조건이 적용되면 중첩 됨
$form_secret = isset($_POST["form_secret"])?$_POST["form_secret"]:'';
$query = "INSERT INTO coupon (user_id,points) VALUES ('$user_id','$points')";
$result=mysql_query($query);
if ($points == 250)
{
$url="http://testext.i-movo.com/api/receivesms.aspx?".$str_from.$str_zip.$phone.$str_time.$date1.$str_msg;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
else if ($points == 500)
{
$url="http://testext.i-movo.com/api/receivesms.aspx?".$str_from.$str_zip.$phone.$str_time.$date1.$str_msg;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
else
{
echo "We are sorry, you don't possess enough points in order to take the coupon";
}
지금까지 완벽했습니다! 그럼 내가 이중 제출을 방지하고 여기에이 코드를 사용하고 있지만 문제는이 모든 코드를이 코드 안에 넣으면 작동하지 않는다는 것입니다. 이 두 코드? 당신이 첫번째 장소에있는 양식을 제출하지 않을 수 있습니다 덕분에 ..
if(isset($_SESSION["FORM_SECRET"]))
{
if(strcasecmp($form_secret, $_SESSION["FORM_SECRET"]) === 0)
{
/*Put your form submission code here after processing the form data, unset the secret key from the session*/
unset($_SESSION["FORM_SECRET"]);
}
else
{
//Invalid secret key
}
}
else
{
//Secret key missing
echo "Form data has already been processed!";
}
* * 작동하지 않는다는 것을 의미합니까? – Tchoupi
그것은 내가 여전히 양식을 제출하면 새로 고침을 의미합니다. .. 다시 .. 제출 작업을 방지하는 위의 코드를 의미하고, 위의 코드는 그저 함께 모을 수는 없습니다. if 구문, else if 등등 .. – Al12
forst 코드 스 니펫에 시작 코드가없는 경우 – Onheiron