0
你好,我已经tryed几个其他发布补丁的,看看有什么我做错了,但它仍然不拉我的cron作业字符串传递变量变量PHP脚本Cron作业调用带有不工作
php -q public_html/conquest/update_power_server.php method=Password
这是我的Cron作业字符串,这是它的调用脚本。
$mymethod = $_SERVER['argv'];
$method = $mymethod[1];
$con=mysqli_connect("localhost", $user_name, $password, $database_name);
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
echo $method;
if($method == $scpassword)
{
$result = mysqli_query($con,"SELECT * FROM `$table_name` WHERE energy < 30");
while($row = mysqli_fetch_array($result))
{
$uuid = $row['uuid'];
$newenergy = $row['energy'] + 1;
mysqli_query($con,"UPDATE `$table_name` SET energy = '$newenergy' WHERE uuid = '$uuid'");
}
mysqli_close($con);
exit;
}else{
echo ("Access Denied!!!");
exit;
}
?>
其调用脚本,但不能figger如何获得的变量传递这样我就可以使用它的任何指向我朝着正确的方向或帮助我解决将是有益的感谢你的帮助。
确定这是我固定的谢谢所有帮助
$mymethod = $_SERVER['argv'];
$arrmethod = $mymethod[1];
parse_str($arrmethod);
echo $method;
http://php.net/manual/reserved.variables.argv.php – DaGardner
刚刚看到它在10分钟内,现在我会看到,如果我的变化工作 –
看看http://php.net/ getopt – bwoebi