Getting a file via http or evaluating a php file and getting its output

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

    #1

    Getting a file via http or evaluating a php file and getting its output

    I need to somehow merge two separate web programs written in php
    together (from the user's perspective). This solution won't be
    perminant, I just need something done quickly. I was thinking of two
    different approches.

    One would be to download a processed version (modified so it will
    create validating html with the page it's being embeded in) of one of
    the programs with the other, then just use print to embed it in the
    page. I couldn't find out how to get a file via http here
    (http://us2.php.net/manual/en/index.php). Sorry if I missed this in
    the docs.

    The other would be to process the other program and get it's command
    line output, and print that.

    If there's a better way to this, I'd be glad to hear it :)

    Also, I've never written any php before; so sorry if I missed
    something obvious to someone who has.
  • Manuel Lemos

    #2
    Re: Getting a file via http or evaluating a php file and gettingits output

    Hello,

    On 10/25/2004 04:10 PM, Brian Peyton wrote:[color=blue]
    > I need to somehow merge two separate web programs written in php
    > together (from the user's perspective). This solution won't be
    > perminant, I just need something done quickly. I was thinking of two
    > different approches.
    >
    > One would be to download a processed version (modified so it will
    > create validating html with the page it's being embeded in) of one of
    > the programs with the other, then just use print to embed it in the
    > page. I couldn't find out how to get a file via http here
    > (http://us2.php.net/manual/en/index.php). Sorry if I missed this in
    > the docs.[/color]

    If your HTTP request is simple, you can do it via fopen(). Now, if it is
    complicated envolving authentication, cookie handling, redirection,
    proxies, special purpose headers, etc.. you may want to try this class
    that can simplify your work retrieving your pages:

    http://www.phpclasses.org/httpclient


    --

    Regards,
    Manuel Lemos

    PHP Classes - Free ready to use OOP components written in PHP
    http://www.phpclasses.org/

    PHP Reviews - Reviews of PHP books and other products
    http://www.phpclasses.org/reviews/

    Metastorage - Data object relational mapping layer generator

    Comment

    Working...