Reputation: 21647
Im using ajax to send data to php and the following is whats being sent
title=2¬e= Logo mynameisdonald%s's Photo mynameisdonald Sign Out Forums Garage Club Shop Classifieds Systems My-STOC Club Advanced This forum Fiesta ST Owners Club → Fiesta ST Mk6 Technical Handbook → Brakes, Wheels & Tyres View New Content Shoutbox Open the Shoutbox in a popup We've noticed that you've been inactive for over 10 minute(s). We've stopped running the Shoutbox due to your inactivity. If you are back again, please click the I'm Back button below. 3 Follow this forum Brakes, Wheels & Tyres Page 1 of 172 1 2 3 Next » Start New Topic Mark this forum as read Recently Updated Start Date Most Replies Most Viewed Custom New Replies Pinned center caps Started by Jim, 22 Jun 2006 1 2 3 13 → Hot 190 replies 5,979 views center caps - last post by ST-Lloydy ST-Lloydy 13 Feb 2013 Pinned Centre Caps Fitting Diagram Started by Scotty H , 20 Mar 2009 6 replies 993 views Centre Caps Fitting Diagram - last post by Toby Toby 01 Nov 2010 New Replies Brakes Started by I9 Conrad 9I, 27 Jan 2013 1 2 3 6 → Hot 84 replies 907 views Brakes - last post by JackJack JackJack 15 minutes ago You posted in this topic Brake pad change - Stiff hubs Started by matt_t586, Yesterday, 23:04 4 replies 25 views Brake pad change - Stiff hubs - last post by matt_t586 matt_t586 Today, 10:01 You posted in this topic ST Caliper Seals Started by mynameisdonald, Today, 09:54 0 replies 2 views ST Caliper Seals - last post by mynameisdonald mynameisdonald Today, 09:54 New Replies Uneven brake pad wear Started by TTC, Yesterday, 19:09 9 replies 55 views Uneven brake pad wear - last post by JackJack JackJack Yesterday, 21:07 New Replies Uniroyal rainsport 2's Started by teeman, 15 Feb 2013 1 2 16 replies 116 views Uniroyal rainsport 2's - last post by sme101 sme101 Yesterday, 13:06 What Centre Cap Fits the Middle of the ST's Wheels. Started by Suicida1 Zombie, 04 Feb 2013 9 replies 87 views What Centre Cap Fits the Middle of the ST's Wheels. - last post by Alec M Alec M Yesterday, 10:20 New Replies Which alloys do you prefer? Started by pop80_uk, 30 Jul 2011 1 2 18 replies 243 views Which alloys do you prefer? - last post by Alec M Alec M Yesterday, 08:30 New Replies Spongey Breaks!?!?!? Started by Suicida1 Zombie, 07 Feb 2013 12 replies 98 views Spongey Breaks!?!?!? - last post by teeman teeman 18 Feb 2013 New Replies Is it difficult to replace calipers? Started by Tommobug, 17 Feb 2013 2 replies 41 views Is it difficult to replace calipers? - last post by Tommobug Tommobug 17 Feb 2013 New Replies Black RS2000 Wheels Started by nated84, 17 Feb 2013 1 reply 25 views Black RS2000 Wheels - last post by STinger STinger 17 Feb 2013 New Replies wheel nuts Started by _Taylor, 17 Feb 2013 1 reply 10 views wheel nuts - last post by sme101 sme101 17 Feb 2013 New Replies escort cossie wheels Started by mikeszetec, 16 Feb 2013 escort cossie wheels on fez 1 reply 29 views escort cossie wheels - last post by STinger STinger 16 Feb 2013 New Replies I'm in need of a new ST500 BLACK Alloy Started by MonsterST, 16 Feb 2013 1 reply 23 views I'm in need of a new ST500 BLACK Alloy - last post by junglistjames junglistjames 16 Feb 2013 New Replies 300mm brake upgrade Started by teeman, 03 Feb 2013 12 replies 163 views 300mm brake upgrade - last post by teeman teeman 16 Feb 2013 New Replies michelin ps3 wet grip Started by kestercook, 11 Feb 2013 michelin, ps3 5 replies 87 views michelin ps3 wet grip - last post by roballan roballan 14 Feb 2013 You posted in this topic Rear Braided Hoses Issue Started by mynameisdonald, 09 Feb 2013 13 replies 124 views Rear Braided Hoses Issue - last post by I9 Conrad 9I I9 Conrad 9I 14 Feb 2013 New Replies kumho tyres Started by harryjones scfc, 12 Feb 2013 9 replies 55 views kumho tyres - last post by teeman teeman 13 Feb 2013 New Replies Braking noise Started by Kane-st, 13 Feb 2013 2 replies 28 views Braking noise - last post by Kane-st Kane-st 13 Feb 2013 Load more topics Page 1 of 172 1 2 3 Next » Start New Topic This forum led by Administrator, Club Staff Community Forum Software by IP.BoardLicensed to: FiestaSTOC.com - Club Network Limited - No. 7955718 Add us on Facebook Follow us on Twitter Watch us on Youtube Subscribe to our RSS Feed RSS Feed Change Theme Mark Community Read Contact Us Privacy Policy Help Time Now: Feb 20 2013 13:13 Last Visit: Feb 18 2013 22:11 Exec. Time: 0.3303 Load: -- Queries: 15 queries Gzip: GZIP Enabled &language=plain&expire=never
This is fine, that's what I want. But when looking at console log at what my php echo's, I'm losing alot of my data.
php file
$note = mysql_escape_string($_POST['note']);
echo $note;
console.log response
\nLogo\n\n mynameisdonald%s\'s Photo\n mynameisdonald \n \n \n Sign Out\n\n \n Forums\n Garage\n Club Shop\n
Classifieds\n Systems\n My-STOC\n Club\n\nAdvanced This forum\n\n Fiesta ST Owners Club\n → Fiesta ST Mk6 Technical Handbook\n → Brakes, Wheels
As you can see by just echoing my text, I've lost a heck of alot of it. Could someone help me?
Upvotes: 0
Views: 131
Reputation: 91762
The easiest way to send your form and avoid encoding problems in jQuery is to use serialize
.
In you ajax call:
data: $("form").serialize(),
Upvotes: 0
Reputation: 10698
You've got to escape your characters : your &
character is interpreted as a delimiter for another key by the POST.
Try encodeURIComponent(string input);
to escape those.
Example : encodeURIComponent($("input[name=foo"]").val().toString());
Upvotes: 0
Reputation: 6723
Don't send it as a string, send it as an object:
dataObj = {
var1: "hello",
var2: 1
};
$.ajax({
type: 'POST',
url: YOUR_SERVER_URL,
data: dataObj,
success: function(data) {
}
});
Upvotes: 3
Reputation: 444
After word Wheels in url param "note" you have "&" which define new params
Upvotes: 1