質問

my operations is:

var SimTxt = "some text & some other text";
...
xmlhttp.send(&SimTxt ="+SimTxt);
...

<?php 
$SimTxt = $_POST['SimTxt'];

echo

 <button id="btn9" class="sim_btn" type="button">
 '.$simBtn10.'
 </button>

But what is printet on screen is only "some text" everything after "&" sign is removed

役に立ちましたか?

解決

Your string needs to be encoded before sending :

..
var SimTxt = encodeURIComponnent("some text & some other text");
xmlhttp.send(&SimTxt ="+SimTxt);
...

-- and the string (which actually is treated as a parameter, and therefore is splitted by &), will not be treated as an URI component by PHP.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top