Hi,
i have found some source in the php manual that allows you to download the source code from a site and take parts of it and put it into a variable, i think. In this case it would take the contents of the <title> tag and print it but thats not happenning.
Im currently using w2k/ntfs/iis5/php4. This is the code i use...
--- emcb_xml.php ---
<?
// Send out the default header
header("Content-Type: text/html");
// Begin App Program Code
$fp = "emcb.xml";
$file = fopen($fp, "r");
if (!$file) {
echo "<p>Unable to open <b>" . $fp . "</b> for Display-XML\n";
exit;
}
while (!feof($file)) {
$line = fgets($file, 1024);
/ This only works if the title and its tags are on one line /
if (eregi("<title>(.*)</title>", $line, $out)) {
$title = $out[1];
}
}
fclose($file);
?>
--- emcb_xml.php ---
i added the header when i got the cgi-error from php
--- emcb.xml ---
<emcb>
<title>Emcb</title>
<url>emcb.co.uk</url>
<image>image.gif</image>
</emcb>
--- emcb.xml ---
and here is what i get from the log
--- emcblog_rs1_10-17-46.log.txt ---
2001-10-29 19:05:35 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:06:38 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:07:40 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:08:42 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 15 HTTP/1.0 - - - -
2001-10-29 19:09:44 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:10:46 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:11:48 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:12:18 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 GET / - 200 0 1960 199 234 HTTP/1.1 websrv-emcb-net Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0) - -
2001-10-29 19:12:51 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 94 HTTP/1.0 - - - -
2001-10-29 19:13:54 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 15 HTTP/1.0 - - - -
2001-10-29 19:14:56 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:15:58 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:17:00 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
2001-10-29 19:17:44 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 GET /emcb_xml.php - 502 0 410 341 310953 HTTP/1.1 websrv-emcb-net Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0) - -
2001-10-29 19:18:02 212.135.179.1 - W3SVC1 WEBSRV-EMCB-NET 212.135.179.1 80 HEAD /robots.txt - 404 2 144 29 0 HTTP/1.0 - - - -
--- emcblog_rs1_10-17-46.log.txt ---
anyone know whats goin on?
Cheers,
Elfyn