Results 1 to 4 of 4

Thread: ($_post Issues) openwysiwyg Php Full Page Intergration

  1. #1
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ($_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

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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

  3. The Following User Says Thank You to djr33 For This Useful Post:

    incineratemediadotnet (03-15-2008)

  4. #3
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks heaps. Advice will be well used/exercised.

  5. #4
    Join Date
    Mar 2008
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •