-
($_post Issues) openwysiwyg Php Full Page Intergration
Hey, if anyone could help it would be awesome
I am currently trying to intergrate openWYSIWYG into a custom CMS for a client.
I have called the desired file using fopen() into the editor.
"<form name="example" method="post" action="action.php">
<textarea id="textarea1" name="page" style="height: 600px; width: 800px;">
<?php
$myFile = "exampletest.php";
$fh = fopen($myFile, 'r+');
$theData = fread($fh,filesize("$myFile"));
fclose($fh);
echo $theData;
;?>
</textarea>
<script language="javascript1.2">
generate_wysiwyg('textarea1');
</script>"
Now i'm trying to post the file to an action page that will write the data.
<?php
$myFile = "exampletest.php";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh,$_POST["page"]);
echo $_POST["page"];
?>
All is well except when the page is echoed the image links change to
"http://www.incineratemedia.net/%22http://www.incineratemedia.net/graphics/header.jpg/%22" and so on as a result of $_POST.
Can can i avoid it writting script like this in a simple method?
Last edited by incineratemediadotnet; 03-15-2008 at 07:43 AM.
Reason: mistake
-
-
You should become familiar with various functions like urldecode(), urlencode(), htmlentities(), htmlspecialchars(), etc. They will fix this, and increase security.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
The Following User Says Thank You to djr33 For This Useful Post:
-
Thanks heaps. Advice will be well used/exercised.
-
-
hmmm this is still a problem. I could be making a mistake.
<?php
$myFile = "exampletest.php";
$sentinfo = $_POST["page"];
$fh = fopen($myFile, 'w') or die("can't open file");
$decode = urldecode("$sentinfo");
fwrite($fh,$decode);
echo "$decode";
?> .. this is the action page after the form.. still no luck as to decoding the images and there paths. Am i missing something?
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks