$val){ // if (!get_magic_quotes_gpc()) { // $$key=addslashes(trim($val)); // }else{ $$key=trim($val); // } } foreach($_POST as $key=>$val){ $$key=trim($val); } //****************************************************************************** switch($op){ case "ip": update_client_ip(); break; } //****************************************************************************** function update_client_ip() { $code=$_REQUEST['code']; $ip=$_SERVER['REMOTE_ADDR']; $db_table='server'; $db_sql=" WHERE code='$code'"; if($code && $ip){ $db_save=" SET"; $db_save.=" ip='$ip'"; $db_save.=", code='$code'"; $db_save.=", active='1'"; $db_save.=", keyin='$code'"; $db_save.=", keyin_time=NOW()"; $code=update_db($db_table,"code",$db_sql,3); if($code){ $a=update_db($db_table,"",$db_save.$db_sql,2); }else{ $a=update_db($db_table,"",$db_save,1); } echo $a.$db_save.$db_sql; } } ?>