Problem passing html thru url
But i have no idea at all what i can do to solve it by my self.
So here it goes,
On my index.php i got four textareas, two is regular, the other two has WYSIWYG editors attached to it.
The two regular contains only:
My Name etc and Some other text the user wants to write.
The two with WYSIWYG editors attached are used to post images, and the form data as in the image is visually shown as a image, but behind the scenes in the WYSIWYG editor its like this:
<img src="" height="" width="" alt="" />
As in regular html code.
I _need_ to pass this once before saveing, and i must pass the html thru get function, or my whole script fails.
But when i pass it, it goes into urlencode i think, and it adds a little "%22" somewhere in my code that makes it look like this:
And that makes it not working.
When i change the url to this:
Then it works, so what i did was to remove the %22 after the image url.
Is there a way to remove the %22 automaticly for each submit of the get form, or is there another way to pass html thru get?
I'm up for using either PHP, HTML or JAVSCRIPT to solve this one.
Hope someone knows a slolution else then changeing form to post, as post will not make it work with the rest of my script.
54 68 65 42 65 61 72 4D 61 79
If you are possibly sending large amounts of data it would be much easier to use POST. Then you won't have to worry about url_encode or url_decode on the server-side at all.
I use this:
$who = str_replace('/\%20/', ' ', $who); //This strips out the %20 you asked for
$who = ereg_replace("[-]", " ", $who); //This removes any dashes
$who = urldecode($who); //This will remove any + signs
on another note, to replace any of those things to re-insert in your search string... you can do this:
$search = ereg_replace("[-]", " ", $search); // This will remove dashes
$search = urlencode($search); // This will encode the URL (replace spaces with + signs
Hi, thanks all for setting some ideas into my head..
I added this to my code
And now my problem is getting closer to be solved
$content_name = $_GET['content0'];
$content_dag = str_replace("/\%22/", " ", $_GET['content1']);
$content_dag = urldecode($content_dag);
$content_dag = str_replace("<", "<", $content_dag);
$content_dag = str_replace(">", ">", $content_dag);
$content_natt = "";
$content_kladd = $_GET['content3'];
$postable = "true";
thats what i have now, so the html is sent
<img src="%5C%22images_dir/lady/image_url.jpg%5C%22" width="154" height="140">
sucessfully, but im still not removing %22 and %5C showed up there to.
What can i do now ?
and thanks again
When adding <img and > in the echo/print
url turned out like this again:
So that dident work so well at all
<img src="%5C%22produkter_org/man/produkter_man_level1.jpg%5C%22" width="150" height="140">
Then im stuck again, so anyone out there with an idea?
I must be missing something in this thread.... where are these characters coming from to start with??? I didn't see that addressed in the posts (or I missed it somehow).
I would eliminate the "problem at it's source instead of trying to fix it after the fact... just a thought.
I cant post my whole code here, as its not small or understandable at all, but ill give you the important things:
So the thing is that i have to update the content of either content2 or content3 without tuching the rest on a refresh.
<form name="my_form" method="get" action="">
<textarea name="content1" id="content1">
This is the textarea with a name
<textarea name="content2" id="content2">
This is the textarea with a WYSIWYG editor attached. and it contains a image, with html code no [img] or anything
<textarea name="content3" id="content3">
This is also a textarea like the other one content2
<textarea name="content4" id="content4">
This is just like content1 only with a bit more text
I solved that by echoing the content after i sent it to URL, but that gave me the issue i need help with, like sending html thru url and decodeing it
to be "showable".
need some more description?
Are you using a standard pre-written WYSIWYG editor? which one?
or one that you put together?
The editor is adding the characters - why? We can only find out seeing that part of the editor... if it is one that everybody has access to it's easy enough to check. If it's not the editor, then it's in the file that you are using to process the output of the editor....
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread