a_moip
并且a_google_analy
是数据库中的整数作为其他字符串
<?
@$c_google = $_POST['c_google_analystics'];
@$c_moip = $_POST['c_moip'];
$code = $_POST['google_analystic'];
$token = $_POST['moip_token'];
$key = $_POST['moip_key'];
if(isset($c_google) or isset($c_moip)) {
if(!isset($c_google)) {
$c_google == 0;
$code == NULL;
}
else {
$c_google == 1;
}
if(!isset($c_moip)) {
$c_moip == 0;
$key == NULL;
$token == NULL;
}
else {
$c_moip == 1;
}
$q = new Query;
$q
->update('config')
->set(
array(
'a_google_analy' => $c_google,
'a_moip' => $c_moip,
'google_analy' => $code,
'moip_token' => $token,
'moip_key' => $key
)
)
->where_equal_to(
array(
'id' => 1 // bug fix
)
)
->run();
}
else {
$q = new Query;
$q
->update('config')
->set(
array(
'a_google_analy' => 0,
'a_moip' => 0,
'google_analy' => NULL,
'moip_token' => NULL,
'moip_key' => NULL
)
)
->where_equal_to(
array(
'id' => 1 // bug fix
)
)
->run();
}
?>
我在数组中打印,变量没有被处理,当它被选中时总是出现。