cURL / Mailing Lists / curl-library / Single Mail

curl-library

Embedding a web page into another page

From: Jeff Dunlap <jeff_j_dunlap_at_yahoo.com>
Date: Tue, 2 Dec 2008 15:18:59 +0000 (UTC)

I have embedded a cgi 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
Received on 2008-12-02