dc6dce4a544fdca2df29d5ac0ea9906b
aab7b2163f674a912497573e9c032a76
bac71aa223f8e2597b0c7113d529493a16b28748ea4df4d9c2150843fecfba68
556a6c83b414607d36d98f12c5fece92852e321c0c6c02724f9ebc4fc5a9d11e姓名:94b3e26ee717c64999d7867364b1b4a3
9695b562baf62c185f62e26e4f9c9567
9c80379f50cc47b7e3ba116ef70f649c16b28748ea4df4d9c2150843fecfba68
f8fd2b4ea3cdc174bae75dd23517799016b28748ea4df4d9c2150843fecfba68
f0ea890fe080c9a36712f18de769c51c7ca3c19e3e32288bf394280bd661e2492a51b86b8fa7ab3506f982031b6a4ac1性别:54bdf357c58b8a65c66d7c19c8e4d114
2e1cf0710519d5598b1f0f14c36ba67478dab470620a8281756889683da3ab4f男8c1ecd4bb896b2264e0711597d40766c
2e1cf0710519d5598b1f0f14c36ba674f1a313f81b7e56b13f2adaad49de28af女8c1ecd4bb896b2264e0711597d40766c 16b28748ea4df4d9c2150843fecfba68
f8fd2b4ea3cdc174bae75dd23517799016b28748ea4df4d9c2150843fecfba68
556a6c83b414607d36d98f12c5fece92d7c8ee1c097170ad4b301ad207a6bb28电话:94b3e26ee717c64999d7867364b1b4a3
2901fc5602d66189509c4e409e904d32b91ae3ad8494f20739c921685827981d16b28748ea4df4d9c2150843fecfba68
f8fd2b4ea3cdc174bae75dd23517799016b28748ea4df4d9c2150843fecfba68
556a6c83b414607d36d98f12c5fece92d7c8ee1c097170ad4b301ad207a6bb28家庭地址:94b3e26ee717c64999d7867364b1b4a3
2901fc5602d66189509c4e409e904d32b8d7e2ddcdbbf27e3744e9cf51dc64ea16b28748ea4df4d9c2150843fecfba68
f8fd2b4ea3cdc174bae75dd23517799016b28748ea4df4d9c2150843fecfba68
556a6c83b414607d36d98f12c5fece923c68f486fd2f43642a110112115dd1b8工种类别:94b3e26ee717c64999d7867364b1b4a3
9695b562baf62c185f62e26e4f9c95674f06ae14c4c04a5a8003c4c912dd7142
3a71655c96dea7ed341d6f2efc8ec8fa请选择工种类别4afa15d3069109ac30911f04c56f3338
859be17dfcd6af2d26185135fb5bd8fc水电工4afa15d3069109ac30911f04c56f3338
656b9f2e82088a1bf3f244445950414e泥瓦工4afa15d3069109ac30911f04c56f3338
9403fa44e4282955565dbaeb33a85ca2油漆工4afa15d3069109ac30911f04c56f3338
0df899068b02ff57e98d12c8174c0b32木作工4afa15d3069109ac30911f04c56f3338
4040e4e71628b3e1ea1a49b7c3d409f1拆卸工4afa15d3069109ac30911f04c56f3338
18bb6ffaf0152bbe49cd8a362034634116b28748ea4df4d9c2150843fecfba68
f8fd2b4ea3cdc174bae75dd23517799016b28748ea4df4d9c2150843fecfba68
556a6c83b414607d36d98f12c5fece92d7c8ee1c097170ad4b301ad207a6bb28从业时间:94b3e26ee717c64999d7867364b1b4a3
2901fc5602d66189509c4e409e904d3212ccf60251456afe297779312799a58816b28748ea4df4d9c2150843fecfba68
f8fd2b4ea3cdc174bae75dd23517799016b28748ea4df4d9c2150843fecfba68
91ac5797828d47ac747818b0c4fe977ed7c8ee1c097170ad4b301ad207a6bb28工作区域:94b3e26ee717c64999d7867364b1b4a3
2901fc5602d66189509c4e409e904d32
5118eea9491d18dab11618323cb3f0e8-->
70bcc8232b6fcf0b3ea0319158bb743e
945b0a2dc2bf653b6b99b3305e961671请选择工作区域(可多选)4afa15d3069109ac30911f04c56f3338
859be17dfcd6af2d26185135fb5bd8fc全岳阳4afa15d3069109ac30911f04c56f3338
656b9f2e82088a1bf3f244445950414e岳阳楼4afa15d3069109ac30911f04c56f3338
9403fa44e4282955565dbaeb33a85ca2云溪4afa15d3069109ac30911f04c56f3338
0df899068b02ff57e98d12c8174c0b32临湘4afa15d3069109ac30911f04c56f3338
4040e4e71628b3e1ea1a49b7c3d409f1汨罗4afa15d3069109ac30911f04c56f3338
632656d9e9cef0578018c73232193c32君山4afa15d3069109ac30911f04c56f3338
18bb6ffaf0152bbe49cd8a362034634116b28748ea4df4d9c2150843fecfba68
57fd4c3c3c54b209d3a0a876b5a3cf4116b28748ea4df4d9c2150843fecfba68
8de1e6e7199f54cdad94590fb117f1b8
556a6c83b414607d36d98f12c5fece92d7c8ee1c097170ad4b301ad207a6bb28自我介绍:94b3e26ee717c64999d7867364b1b4a3
2901fc5602d66189509c4e409e904d3285ea561b3cedd0746b196ff9c2b327af40587128eee8df8f03d0b607fe98301416b28748ea4df4d9c2150843fecfba6857fd4c3c3c54b209d3a0a876b5a3cf4116b28748ea4df4d9c2150843fecfba68
074fa51d9e7cff3999364cdda5dfb6e7
e388a4556c0f65e1904146cc1a846bee(请等待3个工作日,将会有工作人员和您联系)94b3e26ee717c64999d7867364b1b4a3
f5a47148e367a6035fd7a2faa965022e
16b28748ea4df4d9c2150843fecfba68
0b9f73f8e206867bd1f5dc5957dbcb38
c18bee8432ce2879ca8146cf6847387116b28748ea4df4d9c2150843fecfba68
0b9f73f8e206867bd1f5dc5957dbcb38
3e49adb1aaa5b7ddb6cc4396fced9ee0
ff6d136ddc5fdfeffaf53ff6ee95f185
f1b3ba8846c179e65eb68da95b01a8129d1ffa460481ed0ae90a14b8e020927025edfb22a4f469ecb59f1190150159c6首页bed06894275b65c1ab86501b08a632eb16b28748ea4df4d9c2150843fecfba685db79b134e9f6b82c0b36e0489ee08ed
f1b3ba8846c179e65eb68da95b01a8129d1ffa460481ed0ae90a14b8e020927025edfb22a4f469ecb59f1190150159c6找长工bed06894275b65c1ab86501b08a632eb16b28748ea4df4d9c2150843fecfba685db79b134e9f6b82c0b36e0489ee08ed
f1b3ba8846c179e65eb68da95b01a8129d1ffa460481ed0ae90a14b8e020927025edfb22a4f469ecb59f1190150159c6零工市场bed06894275b65c1ab86501b08a632eb16b28748ea4df4d9c2150843fecfba685db79b134e9f6b82c0b36e0489ee08ed
f1b3ba8846c179e65eb68da95b01a8129d1ffa460481ed0ae90a14b8e020927025edfb22a4f469ecb59f1190150159c6招投标平台bed06894275b65c1ab86501b08a632eb16b28748ea4df4d9c2150843fecfba685db79b134e9f6b82c0b36e0489ee08ed
f1b3ba8846c179e65eb68da95b01a8129d1ffa460481ed0ae90a14b8e020927025edfb22a4f469ecb59f1190150159c6个人中心bed06894275b65c1ab86501b08a632eb16b28748ea4df4d9c2150843fecfba685db79b134e9f6b82c0b36e0489ee08ed
929d1f5ca49e04fdcb27f9465b944689
16b28748ea4df4d9c2150843fecfba68
3f1c4e4b6b16bbbd69b2ee476dc4f83a
function isMobile(a) //验证手机号码
{
var reg = /^(13|15|18|17)[0-9]{9}$/; //正则表达式
return reg.test(a);
}
$('#btn_submit').click(function(){
//xm xb sjhm jtdz gzlb cysj gzqy note
var xm=$("#xm").val();
//alert(xm);
if(xm == '')
{
$("#msg").html('没有填写姓名!');
return false;
}
var xb=$("#xb").val();
if ($(":radio:checked").length == 0)
{
$("#msg").html('没有选择性别!');
return false;
}
var sjhm=$("#sjhm").val();
if( isMobile(sjhm) == false)
{
$("#msg").html('没有填写手机号码!');
return false;
}
var jtdz=$("#jtdz").val();
if( jtdz == '')
{
$("#msg").html('没有填写家庭住址!');
return false;
}
var gzlb = document.getElementById("gzlb").value; //selectid
//var index = obj.selectedIndex; // 选中索引
//var text = obj.options[index].text; // 选中文本
//var value = obj.options[index].value; // 选中值
if(gzlb == "0")
{
$("#msg").html('请选择工种类别!');
return false;
}
//alert(obj);
var cysj=$("#cysj").val();
if ( cysj == '')
{
$("#msg").html('没有选择从业时间!');
return false;
}
var gzqy = document.getElementById("gzqy").value;
if( gzqy == '0')
{
$("#msg").html('请选择工作区域!');
return false;
}
var note=$("#note").val();
if( note == '')
{
$("#msg").html('没有填写自我介绍!');
return false;
}
$.ajax({
url:"./index_c.php",
type:"POST",
data:{"xm":xm, "xb":xb, "sjhm":sjhm, "jtdz":jtdz, "gzlb":gzlb, "cysj":cysj,"gzqy":gzqy,"note":note},
dataType:"json",
async : false,
success:function(){
//alert('success');
if(error==0)
{
$("#btn_submit").attr("disabled","disabled");
$("#btn_submit").css({"background":"#0000000"});
$("#msg").html('提交成功!');
}
else{
$("#msg").html(msg);
}
},
error:function(){
alert('error');
//$("#msg").html("提交异常!");
}
});
return false;
});
2cacc6d41bbb37262a98f745aa00fbf0
这是全部代码 求大神帮我检查下
回复讨论(解决方案)
data:{"xm":xm, "xb":xb, "sjhm":sjhm, "jtdz":jtdz, "gzlb":gzlb, "cysj":cysj,"gzqy":gzqy,"note":note},
中的所用变量都没有赋值!
dataType:"json",
要求服务端返回 json 数据
data:{"xm":xm, "xb":xb, "sjhm":sjhm, "jtdz":jtdz, "gzlb":gzlb, "cysj":cysj,"gzqy":gzqy,"note":note},
中的所用变量都没有赋值!
dataType:"json",
要求服务端返回 json 数据
<?php ob_start(); session_start(); header("Content-Type: text/html; charset=UTF-8"); //xm xb sjhm jtdz gzlb cysj gzqy note $xm = isset($_POST['xm'])?$_POST['xm']:''; $xb = isset($_POST['xb'])?$_POST['xb']:''; $sjhm = isset($_POST['sjhm'])?$_POST['sjhm']:''; $jtdz = isset($_POST['jtdz'])?$_POST['jtdz']:''; $gzlb = isset($_POST['gzlb'])?$_POST['gzlb']:''; $cysj = isset($_POST['cysj'])?$_POST['cysj']:''; $gzqy = isset($_POST['gzqy'])?$_POST['gzqy']:''; $note = isset($_POST['note'])?$_POST['note']:'';try{ /* if(strlen($note)>200){ //throw new Exception("自我介绍超过了200个字符!"); $data=array( "error"=>1, "msg"=>"<自我介绍>输入了 " . strlen($note) ." 个字符,超过了200个字符!" ); echo json_encode($data); exit; } */ /* if(isset($_POST['xm'])) { $xm=trim($_POST['xm']); // check forms filled in if (empty($xm)) { echo'<div align="center"> 用户名必须填写,' .' 请重新输入 <a href="你的文件名.php">返回</a><br>'; exit; } } */ $date = date("Y-m-d H:i:s"); $conn = mysql_connect("localhost","root","123456"); mysql_select_db("test", $conn); mysql_query("set names 'utf8'"); $sql="SELECT count(1) as RecordCount FROM fhzj where sjhm='$sjhm'"; $result = mysql_query($sql); if($result) { $row = mysql_fetch_assoc($result); $recordCount = $row['RecordCount']; if($recordCount > 0) { $data=array( "error"=>1, "msg"=>"手机号码已经存在!" ); echo json_encode($data); exit; } } else { $data=array( "error"=>1, "msg"=>mysql_error() ); echo json_encode($data); exit; } $sql="INSERT INTO `fhzj` (`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)"; $sql = $sql . " values(`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)"; $result = mysql_query($sql, $conn); if(!$result){ $data=array( "error"=>1, "msg"=>mysql_error() ); echo json_encode($data); throw new Exception(" 异常情况:" . mysql_error()); //throw new Exception($sql); } else { $data=array( "error"=>0, "msg"=>"提交成功" ); echo json_encode($data); } $data=array( "error"=>0, "msg"=>"提交成功" ); echo json_encode($data); }catch(Exception $ex){ $data=array( "error"=>1, "msg"=>$ex->getMessage() ); echo json_encode($data); } ?>
把
data:{"xm":xm, "xb":xb, "sjhm":sjhm, "jtdz":jtdz, "gzlb":gzlb, "cysj":cysj,"gzqy":gzqy,"note":note}
输出看,是否有值
再看看你的sql语句
$sql="INSERT INTO `fhzj` (`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";
$sql = $sql . " values(`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";
你的values都没赋值
data:{"xm":xm, "xb":xb, "sjhm":sjhm, "jtdz":jtdz, "gzlb":gzlb, "cysj":cysj,"gzqy":gzqy,"note":note},
中的所用变量都没有赋值!
dataType:"json",
要求服务端返回 json 数据
这是我的PHP代码 请问我该在哪赋值啊 不好意思 我是才入行 基础不太好 麻烦你解释下
$sql="INSERT INTO `fhzj` (`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";
$sql = $sql . " values(`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";
你的values都没赋值
我应该这么写么
var "xm" = xm
不好意思我是小白 实在
$sql = $sql . " values(`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";改成 $sql = $sql . " values('$xm')";//后面几个以此类推
$sql = $sql . " values(`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";改成 $sql = $sql . " values('$xm')";//后面几个以此类推
我应该在前面的判断里面赋值过了吧
$sql = $sql . " values(`xm`,`xb`,`sjhm`,`jtdz`,`gzlb`,`cysj`,`gzqy`,`note`)";改成 $sql = $sql . " values('$xm')";//后面几个以此类推
还是不行 提示错误
你可以在你要用的变量两边加上{},因为双引号中 { 变量 } 这样才可以解析
你可以在你要用的变量两边加上{},因为双引号中 { 变量 } 这样才可以解析
你可以示例下么
你可以在你要用的变量两边加上{},因为双引号中 { 变量 } 这样才可以解析
你可以示例下么
$sql = "insert into 表名(你要使用的字段名) values(`{$xm}`,`{$xb}`,`{$sjhm}`,`{$jtdz}`,`{$gzlb}`,`{$cysj}`,`{$gzqy}`,`{$note}`)";
这样可以试一下输出$sql,看看双引号里的变量解析没有