Simple PHP Question

Discussion in 'PHP' started by aditya_sfs, Sep 29, 2006.

  1. #1
    Hello guys

    I need a small help. Can anyone tell me how to call and store the output of a PHP script in a variable in another PHP script.

    I have a php script test.php which when run outputs some HTML page..

    I want another PHP script which executes this above one and stores its HTML output in a $message variable which will be sent as a email.

    regards
    aditya
     
    aditya_sfs, Sep 29, 2006 IP
  2. webbist

    webbist Peon

    Messages:
    89
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $message = file_get_contents("http://www.yoursite.com/test.php");

    That should do it. Use file() to feed it into an array instead of as a string.
     
    webbist, Sep 29, 2006 IP