Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

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