Capturing output of another script as a string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jerrygarciuh

    Capturing output of another script as a string

    Hello,

    I have a client who has decided to output the OO PHP/mySQL site I have made
    for them onto a cd.

    I realize that $html = include('somefi le.php'); gets 1 for success as its
    return value.

    In what manner can I access my files so what would be output to the browser
    from 'someFile.php?i d=1213'

    gets into $someVar as a string so I can write it to a static file for the
    CD?

    TIA for any advice!!!

    jg


  • jerrygarciuh

    #2
    Re: Capturing output of another script as a string

    This was the ticket:


    /*set whatever values will be printed in the template*/
    $filename1 = "$host$dir$file ?$q";
    /*start the output buffering*/
    ob_start();
    /*include the tempate file*/
    include("$filen ame1");
    /*get the contenst of the output buffer*/
    $data = ob_get_contents ();
    /*write the contents to a file*/
    $fp = fopen("cd/test.html","w") ;
    fwrite($fp,$dat a);
    fclose($fp);
    /*clear the output buffer*/
    ob_clean();


    "jerrygarci uh" <designs@no.spa m.nolaflash.com > wrote in message
    news:Oh%0d.4334 9$mu.23748@okep read07...[color=blue]
    > Hello,
    >
    > I have a client who has decided to output the OO PHP/mySQL site I have[/color]
    made[color=blue]
    > for them onto a cd.
    >
    > I realize that $html = include('somefi le.php'); gets 1 for success as its
    > return value.
    >
    > In what manner can I access my files so what would be output to the[/color]
    browser[color=blue]
    > from 'someFile.php?i d=1213'
    >
    > gets into $someVar as a string so I can write it to a static file for the
    > CD?
    >
    > TIA for any advice!!!
    >
    > jg
    >
    >[/color]


    Comment

    • steve

      #3
      Re: Capturing output of another script as a string

      "jerrygarci uh" wrote:[color=blue]
      > Hello,
      >
      > I have a client who has decided to output the OO PHP/mySQL site I[/color]
      have[color=blue]
      > made
      > for them onto a cd.
      >
      > I realize that $html = include(’somefi le.php’); gets 1 for
      > success as its
      > return value.
      >
      > In what manner can I access my files so what would be output to the
      > browser
      > from ’someFile.php?i d=1213’
      >
      > gets into $someVar as a string so I can write it to a static file[/color]
      for[color=blue]
      > the
      > CD?
      >
      > TIA for any advice!!!
      >
      > jg[/color]

      You can run your script from a command-line browser (Lynx avail. in
      linux and Windows), and have the output piped to a file.

      --
      http://www.dbForumz.com/ This article was posted by author's request
      Articles individually checked for conformance to usenet standards
      Topic URL: http://www.dbForumz.com/PHP-Capturin...ict148837.html
      Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=498507

      Comment

      Working...