Is it safe to use the Javascript 'escape' function to encode a string, and then use the php function urldecode to unravel it? They seem to almost work ... but not quite!
basically I'm tyring to build a very simple 'wysiwyg' editor and I need to send html code from an input box to a new page where the code actually written out (previewed) but upon decoding, I find things like the quotes being escaped ... which causes a few probs! eg
start with:
<a href="employees_template.php?id=23a§ion=employees\" alt=\"Additional Voluntary Contributions\";>
this is a link
</a>
javascript escape to:
%0A%3Ca%20href%3D%22employees_template.php%3Fid%3D23a%26section%3Demployees%22%20alt%3D%22Additional+Voluntary+Contributions%22%3B%3E%0D%0A%0D%0A%3C/a%3E%0D%0A
php urldecode on next page to:
<a href=\"employees_template.php?id=23a§ion=employees\" alt=\"Additional Voluntary Contributions\";>
this is a link
</a>
can anyone see how I should do this so that the " are not escaped and the link previewed correctly?
ta for any help
Chris!