jQuery ajax的前台代码:
PHP的后台代码:
header("Cache-Control: no-cache");
require_once("function.php");
switch ($_POST["action"]){
case 1:
$comid=verify_id($_POST["comid"]);
$jobid=verify_id($_POST["jobid"]);
$userid=verify_id($_POST["userid"]);
$appdate=time();
$hasapp=getValue("select * from csj_appjob where jobid=$jobid and userid=$userid and comid=$comid","id");
if($hasapp==""){
$sql="insert into csj_appjob(comid,jobid,userid,appdate) values($comid,$jobid,$userid,$appdate)";
query($sql);
echo "success";
}else{
echo "wrong";
}
break;
default:
break;
}
?>
更多相关文章请关注PHP中文网(m.sbmmt.com)!