Hi this is my first post on here so any response would be greatly appreciated. I'm working on a complex php form and keeping getting this error. Parse error: syntax error, unexpected T_VARIABLE in /home2/happyusa/dev/member/rec_id_check.php on line 8
<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)">
follow is /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 }
Parse error: syntax error, unexpected T_VARIABLE in /home2/happyusa/dev/member/rec_id_check.php on line 8
My QUESTION What is wrong? I need your help!!!!