0

ok so i am using jquery ajax to send post data to the php page to get processed. since im using a textarea with an editor on it i have to call the content like so

var content = $('#pagecontent').val();

then post it through to the php page. which works but it seems to have a problem with a an & symbol in the post data. it cuts off the rest of the code after an & symbol.

when get the contents of the textarea with
console.log($("#pagecontent").val())

it grabs all the content. Even the content after the & symbol. then i post it through and have php output the contents that is submitted and then i see that the rest of the content after the & is gone.

So the problem that i am having is why is the ajax posting cutting off my content after an & symbol. it seems to grab the content fine before the submitting.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by itisnot_me
0

php interprets the "&" symbol as a URL parameter separator. Try substituting the & symbol with its hexadecimal value "%26", without parenthesis, before posting to php.

0

I think the issue was that i was using the ajax instead of post for jquery. Also i used a totally different editor as the one i was using sucked in support

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.