Click to See Complete Forum and Search --> : Include not working


theuedimaster
08-24-2004, 12:40 PM
Okay, I am creating a bunch of pages that will be able to check prices of many products that I need to keep a watch on. Basically, I am using many divs with scroll bars activated, and using the php include statement to include the page that I need to see, that includes price and information. Okay, here is one that works:

(Note, 6 pages will load inside, so you probably want some sort of high-speed internet to load up site)

http://www.sigmaseven.net/price_check.php

However, on this page it doesn't work, I don't know why, I think maybe the other server isn't letting me....uh....

http://www.sigmaseven.net/zzf_cpu.php

Here is the code for this page:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>
<div id="Layer1" style="position:absolute; left:0px; top:0px; width:535px; height:600px; z-index:1; overflow: scroll;">
<?
include("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80656-800");
?>
</div>
<div id="Layer1" style="position:absolute; left:535px; top:0px; width:535px; height:600px; z-index:1; overflow: scroll;">
<?
include("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80661");
?>
</div>
<div id="Layer1" style="position:absolute; left:0px; top:600px; width:535px; height:600px; z-index:1; overflow: scroll;">
<?
include("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80663");
?>
</div>
<div id="Layer1" style="position:absolute; left:535px; top:600px; width:535px; height:600px; z-index:1; overflow: scroll;">
<?
include("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80664");
?>
</div>
<div id="Layer1" style="position:absolute; left:0px; top:1200px; width:535px; height:600px; z-index:1; overflow: scroll;">
<?
include("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80667");
?>
</div>
<div id="Layer1" style="position:absolute; left:535px; top:1200px; width:535px; height:600px; z-index:1; overflow: scroll;">
<?
include("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80668");
?>
</div>



<!-- here is height div -->
<div id="Layer2" style="position:absolute; left:849px; top:423px; width:44px; height:2900px; z-index:2"></div>
</body>
</html>


Help would be awesome, Thanks!

Jona
08-24-2004, 02:18 PM
You can't include remote files, that I know of, as that may allow remote connections to databases, etc. Try using readfile() instead.

theuedimaster
08-24-2004, 07:59 PM
it still doesn't work... i don't know why

MstrBob
08-24-2004, 08:05 PM
There's nothing wrong with the PHP. The website you're including is using relative URLs for their images, and since these images aren't on your server (and since they appear to be dynamic, you wouldn't want that) the images can't be accessed. One thing you could do is use file_get_contents() to grabe the file contents, and use a preg_replace to have all img src's start off with the website's address.

MstrBob
08-24-2004, 08:17 PM
Instead of doing includes, you can use this:


<?PHP
$page=file_get_contents("http://www.zipzoomfly.com/jsp/ProductDetail.jsp?ProductCode=80668");
$page=preg_replace("/\\<img(.*?)src=\"(.*?)\"/i", "<img$1src=\"http://www.zipzoomfly.com$2\"", $page);
echo($page);
?>