Forum Moderators: coopster
<?php
if( $_POST["username"] == "samy" )
echo "yes"
else
echo "no"
?>
in my javascript code i am checking the response text for yes or no like the following
if(ajax.responseText=="yes")
alert("Welcome samy");
else
alert("invalid username");
the problem is before the letter y in yes a new line is inserted...
why it is so... is there any method to stop it while sending the response back from the php page... it is fine to do manual removal or split of new line but i want to know why it is a case and what has to be done...?