I want to send something from one php site to another. At the first site, everything seems fine. The string seems like
--show="author,book,text/n
but when i check the string after receiving it looks like
--show="author,book,text/r/n
there is the problem, somehow it adds /r
in the end.
First php:
$(document).ready(function() {
$("#column_button").click(function(){
var selected = [];
$.each($("input[name='checkbox_columns']:checked"), function(){
selected.push($(this).val());
});
var data = new FormData();
data.append("data", "--show=" + selected);
//alert(JSON.stringify(selected));
var ajax = (window.XMLHttpRequest) ? new XMLHttpRequest() : new activeXObject("Microsoft.XMLHTTP");
ajax.addEventListener("load", statusHandler2, false);
ajax.open( 'post', 'showParameter.php', true );
ajax.send(data);
_("column_button").disabled=true;
});
});
Second php:
if(!empty($_POST['data'])){
$data = $_POST['data'];}
So selected shows it right, but if i check the $data in the second php, it's wrong.