#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    32
    Rep Power
    15
    Hi,

    I was wondering if i can get help on how to go about writing a file using a template. The template does several calls to the database and all parses out nicely.. but i want to save that as a static html page.

    I've tried to use the fputs but it needs a string... and I'm stumped here. Has anyone tried doing this and has an example I could follow?

    Thanks..
    scoobydoo
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Somewhere,in,UK
    Posts
    9
    Rep Power
    0

    You could cheat Get the output as you would want it, and have it called with
    lynx -source http://localhost/page.php > static.html

    Kelv



    ------------------
    ------------------------
    Kelv (29359814)
    http://www.lohost.com
    Low cost high uptime
    for your sites.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    32
    Rep Power
    15
    Hi kelv,

    Sorry I'm not familiar with lynx. Could you explain this?
    If so.. can i use one of the php functions to call upon this command? eg. exec() ??

    I've tried many ways, eg popen and readfile.. none seem to work for me.. i'm not sure why it's not working.

    anybody know of a way?

    scoobydoo
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Germany
    Posts
    2
    Rep Power
    0
    hi,

    maybe you can try to solve it like that:

    $id = 123;
    $url="http://localhost/page.php3?id=$id";

    $fpi = fopen($url, "r");
    $fpo = fopen("rec".$id.".htm", "w");

    while ($line = fgets($fpi, 200))
    {
    fputs($fpo, $line, 200);
    }

    fclose($fpi);
    fclose($fpo);

    hope this will help you...

Similar Threads

  1. Replies: 11
    Last Post: February 21st, 2004, 06:48 AM
  2. Replies: 0
    Last Post: February 8th, 2004, 10:11 PM
  3. Replies: 2
    Last Post: February 4th, 2004, 11:10 PM
  4. passing the url from HTML page to a php
    By lordorkus in forum PHP Development
    Replies: 10
    Last Post: January 20th, 2004, 05:36 PM
  5. non-SSL -> SSL page variable transfer? + your CF webhost?
    By vinyl in forum ColdFusion Development
    Replies: 16
    Last Post: January 19th, 2004, 01:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo