Tuesday, 15 June 2010

php - how to pass html code block using ajax and saving it to mysql -



php - how to pass html code block using ajax and saving it to mysql -

i trying save html ajax code:

var textz = "<!doctype html> <html> <head> </head> <body> test</body> </html>"; $.ajax({ type: "get", url: 'ajaxcall.php', data: {valeur:encodeuricomponent(textz),userid:userids}, success: function (dataz) { //$("#resultat").html(dataz); }, datatype: "html" });

it saves , looks :

%3c!doctype%20html%3e%0a%3chtml%3e%0a%3chead%3e%0a%3c%2fhead%3e%0a%3cbody%3e%0test%0a%3c%2fbody%3e%0a%3c%2fhtml%3e

but in case don't know how alter html. opposite encodeuricomponent in php ?

$decoded = urldecode ( $encoded );

see: http://www.php.net/manual/en/function.urldecode.php

php jquery html mysql ajax

No comments:

Post a Comment