Jump to content
joelwu

JQuery receive value from php echo value issue

Recommended Posts

Hi, I have a JQuery code that read the value echo back from php, it echo a value "1" as shown the code bellow, however I get additional information from the variable as shown in the result, how can I get rid of this?

 

JQuery Code on index.html$("#login").click(function(){ $.post("php/connect.php", {id:"?????", pw:"????"}, function(data) { alert(data); });});Php Code on connect.phpif($id != null && $pw != null && $row[1] == $id && $row[2] == $pw){ echo '1';else{ echo '0';}Result that return at variable data<meta http-equiv="Content-Type" c /><meta http-equiv="Content-Type" c />1

Share this post


Link to post
Share on other sites

Those meta tags are coming from somewhere, you'll need to find where they're coming from and suppress or remove them.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...