in Education by
I'm sending HTML trough POST and the '&'s are messing it up, how can I avoid it? Tried replacing & with \&, didn't work. For more info: I'm trying to use email templates in an in-house project and stuff like &nbsp is screwing up the POST i'm using to send them from javascript to php. code below: emailcontinut = CKEDITOR.instances['emailContinut'].getData(); var parametri = "Trimite="+trimite + "&codc="+codc + "&emailSubiect="+emailsubiect + "&emailContinut="+emailcontinut + "&adact="+adact + "&sid="+Math.random(); xmlhttp_email_actiune.open("POST",url,true); xmlhttp_email_actiune.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp_email_actiune.setRequestHeader("Content-length", parametri.length); xmlhttp_email_actiune.setRequestHeader("Connection", "close"); xmlhttp_email_actiune.send(parametri); when I echo $_POST['emailContinut'] in the target PHP, it stops at the first '&' in an &nbsp the solution was just emailcontinut = escape(emailcontinut); in javascript and then using stripslashes() in php to decode it. thanks. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You need to URL-encode and/or HTML-encode your content, depending on what you're actually doing.

Related questions

0 votes
    i must set styles within other styles from a page that have a style like this: * { width : 200px ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    i must set styles within other styles from a page that have a style like this: * { width : 200px ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I Know I can do this with static HTML, but I want to create dynamically, and I am struggling a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 12, 2022 in Education by JackTerrance
0 votes
    I Know I can do this with static HTML, but I want to create dynamically, and I am struggling a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I have the access to this DOM node in temp1.$el. And here is the content which the above variable ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have the access to this DOM node in temp1.$el. And here is the content which the above variable ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I have the access to this DOM node in temp1.$el. And here is the content which the above variable ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I am developing a web page code, which fetches dynamically the content from the server and then places this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I just added a textarea to my page which is an "include" to another page...I have some script ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    I just added a textarea to my page which is an "include" to another page...I have some script ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    I mean this Datepicker: https://uxsolutions.github.io/bootstrap-datepicker/ HTML: Fecha de inicio Fecha de ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
0 votes
    How can I apply my div position x value to a variable? And how to iterate it in a for loop? ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a landing page with sticky header. When user start scroll and the page displays .second-section . ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have a landing page with sticky header. When user start scroll and the page displays .second-section . ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
...