回发脚本问题

时间:2017-01-24 08:59:45

标签: php

我一直在努力查看我的回发脚本的问题,

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "";

$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
//$adscendIp = "xx.xx.xx.xx"; // ip for adsc

//if($_SERVER['REMOTE_ADDR'] != $adscendIp)
//{
//die("Access Denied!");
//}

$campid = $_GET['campid']; // ID number of the campaign credited
$sid = $_GET['sid']; // The SubID that was passed in the campaign link
$rate = $_GET['rate']; // Commission earned (Will be negative if status is revoked)
$status = $_GET['status']; // Status of the lead. 1 for payable, 2 for revoked
$name = $_GET['name']; // Name of the campaign
$ip = $_GET['ip']; // IP address of the user 
$cur = $_GET['cur'];
$sb1 = $_GET['sb1'];

if($status == "1")
{

    mysqli_query($conn,"UPDATE users SET balance = '.$cur.' WHERE steamid = '.$sd1.'");

}
else
{
die("Revoked Lead!");
}
?>

我试过去链接并将正确的变量放在网址中它似乎有效,但是当我在提供墙上尝试它失败时,有什么你可以看到错误的脚本。

1 个答案:

答案 0 :(得分:0)

你的所有变量,即来自任何html表单的campid,sid等? 然后以那种形式设置方法帖子。 &安培;然后在PHP代码中使用$ _POST ...

获取所有参数
$campid = $_POST['campid'];
$sid = $_POST['sid']; 
$rate = $_POST['rate'];