Save Output of PHP Page

Discussion in 'PHP' started by vsphp, Jul 24, 2007.

  1. #1
    I need help with saving out put from a php page. There are two pages. One is a form page and one is a page which processes the form. I don't have access the page which processes the form but the that page returns the output for whatever I submit using the form page.

    What I want to do is to save the resulted output from the second page once someone clicks on the submit button. This output should be saved to the xml file in the local directory.

    NOTE: I dont' have access to the second page...it only returns the output for whatever i submit from the first page (form).

    Thanks.
    Any help will greatly be appreciated.
     
    vsphp, Jul 24, 2007 IP
  2. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #2
    I suppose CURL can be used to submit user data to second page.
    In short - you get user data, submit it to the second page with curl functions (or snoopy class if you don't have curl on your host installed) and grab output. If needed you show this output back to user.
     
    AsHinE, Jul 25, 2007 IP
  3. bloodredxxx

    bloodredxxx Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    just use the

    @ob_start();
    Code (markup):
    function before any output, then add this code at the end:

    $pagesource=ob_get_contents();
    ob_end_flush();
    $fd = fopen ("output.html", "w");
    fwrite ($fd, $pagesource);
    fclose($fd);
    
    Code (markup):
    the output should be saved in the output.html file.
     
    bloodredxxx, Jul 25, 2007 IP