Log in

View Full Version : Php remote include


manutd4eva
Jan 10, 2006, 02:35 PM
Hi why won't this code work have I done something wrong? Thanks



<html>
<head>
<title>test</title>
</head>


<body>
<?php include("http://www.sportinglife.com/football/popup/live_tables.auto?/opt/ASFapache/htdocs/site/football/live/tables/premiership.insdat"); ?>
</body>

</html>

LTheobald
Jan 11, 2006, 04:18 AM
The code looks OK to me but there could be a number of things stopping this.

First read the paragraph starting "If "URL_fopen_wrappers[/URL]" are enabled in PHP..." (under example 16-6) on the [url=http://us2.php.net/include/]PHP Manual (http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen) for the include function.

Secondly, importing a page like this is going to mess up your HTML. For example it may read:



<html>
<head>
<title>test</title>
</head>


<body>
<html>
<head>
<title>Sporting Life - Football: Live</title>
<link rel=stylesheet type="text/css" href="http://www.sportinglife.com/styles/main_styles.css">
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Refresh" CONTENT="90">
</title>
</head>
<body bgcolor="#f1f0fe"
>
Chances are this will mess up the look or the page you are trying to include it on.

Next - just including like this is BAD. I think you may be breaking copyright. This will also push up the bandwidth usage of the site you are importing (bad).



I'll keep looking for the correct answer though.

manutd4eva
Jan 11, 2006, 03:17 PM
I seen a link before on the site with "link too us". Its not there now -dosnt work anyway. I will email the people when I get time