嗨,这是我在这里的第一篇文章,所以任何回复都将不胜感激。我正在处理一个复杂的PHP表单,并不断收到此错误。 解析错误:语法错误,第8行/home2/happyusa/dev/member/rec_id_check.php中的意外T_VARIABLE
<script>
function check_rec_id(obj) {
if(obj.value.length < 6) {
document.this_form.recidcheck.value = 'N';
$('#check_rec_id_msg').html('recID must be over 6 letters');
$('#check_rec_id_msg').css('color','red');
return;
}
$.ajax({
type: 'post',
async: true,
url: '/member/rec_id_check.php',
data: 'id=' + encodeURIComponent(obj.value),
beforeSend: function() {
//$('#ajax_load_indicator').show().fadeIn('fast');
},
success: function(data) {
$('#check_rec_id_msg').html(data);
return;
},
error: function(data, status, err) {
alert('fail to connect to server');
},
complete: function() {
//$('#ajax_load_indicator').fadeOut();
}
});
return;
}
</script>
<td><input name="rec_uid" type="text" class="input-style" id="rec_uid" style="width:250px; border-color: #0066ff" maxlength="12" onKeyUp="check_rec_id(this)">
关注是/member/rec_id_check.php
1
2
3
4
5
6 $rec_uid = trim($rec_uid)
7
8 $sql = "select count(*) from member where uid = '$rec_uid'";
9 $result = mysql_query($sql);
10 $rowcount = mysql_result($result, 0, 0);
11
12 if ($rowcount > 0) {
13 echo "recID is available";
14 echo "<script>$('#check_rec_id_msg').css('color','blue');</script>";
15 exit;
16 }
17
18 elseif ($rowcount = 0) {
19 echo "recID is not available";
20 echo "<script>$('#check_rec_id_msg').css('color','red');</script>";
21 exit;
22 }
解析错误:语法错误,第8行/home2/happyusa/dev/member/rec_id_check.php中的意外T_VARIABLE
我的问题 怎么了?我需要你的帮助!!!!
答案 0 :(得分:8)
您在第6行末尾缺少分号(;
):
$rec_uid = trim($rec_uid);