The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 3 of 3

Thread: updating content on a HTML page from php??

  1. #1

    updating content on a HTML page from php??

    Hey all,

    i'm trying to update a html page from php which pulls variables from flash which all works fine and does update...BUT all my html code is missing and not showing...so i have tried to capture the htmldata(code) from the file and write to the same file as its updated so that it will hopefully update and have html styles to.

    here is the code: (it currently doesn't work but the basic fwrite etc updates fine)

    PHP Code:
    <?php
    $filename 
    $_POST["filename"];
    $theText $_POST["theText"];

    $theText = ($theText);

    $url "http://www.myURL.com";
    $sourcepage "$url/images/folder/monthly_newsletter.php";

    $dynamic_source fopen($sourcepage'r'); 
    if (!
    $dynamic_source) {
    echo 
    "<strong>Unable to load $sourcepage
    - Static page! Update Failed!</strong>"
    ;
    exit();
    }

    $htmldata fread($dynamic_source1024*1024);
    fclose($dynamic_source);
    $filename fopen($sourcepage'w');

    $data fopen($filename"w");

    fwrite($data,$theText,$htmldata);

    fclose($data);

    echo 
    "File created or updated";

    ?>
    any help would be great

    Cheers Peeps

  2. #2

    when you view the source code of the newsletter after being updated it looks as follows:

    HTML Code:
    <TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"12\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">hello world</FONT></P></TEXTFORMAT>
    which is the html text coming out of the flash text field. so somehow i would need to capture the html code from the file and write it to the same document but only when its updated.

    Cheers all

  3. #3
    i think i'm closer to my problem i'm using "w" in my php file which writes over whatever was stored in the file (i.e. my html code) is there another method to write only to the variable textfield instead of the whole file???

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012