cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Embedding a web page into a PHP page

From: Andrey Kuznetsov <kandrey89_at_gmail.com>
Date: Tue, 2 Dec 2008 11:13:17 -0800

Looks good, though have you tried putting the php tags inside html
tags in a .php file?
Such as :

<html>
<head></head>
<body>

<?php
$remote = fopen("http://127.0.0.1/my_site/DailyComics.cgi", "r");
fpassthru($remote);
?>

</body>
</html>

On Tue, Dec 2, 2008 at 8:36 AM, Jeff Dunlap <jeff_j_dunlap_at_yahoo.com> wrote:
> I have embedded a cgi web application into a PHP page as follows:
>
> <?php
> $remote = fopen("http://127.0.0.1/my_site/DailyComics.cgi", "r");
> fpassthru($remote);
> ?>
>
> Everything looks good, the comics are embedded nicely into my PHP page.
>
> Please note that the cgi does not produce <html>, <head>, <body> tags (since
> the PHP application puts them where required).
>
> My questions are:
>
> 1) Am I using the correct syntax to embed the cgi into the PHP page?
>
> 2) The cgi application is returning the HTTP response below. Is this ok or do
> we have to modify something? See below:
>
> HTTP/1.1 200 OK
> Server: Microsoft-IIS/5.1
> Date: Tue, 02 Dec 2008 15:14:32 GMT
> Content-Type: text/html
> Connection: Keep-Alive
> Content-Length: 1054
>
> Thank you very much,
>
> Jeff
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

-- 
Andrey
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-12-02