/    Sign up×
Community /Pin to ProfileBookmark

Include not working

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)

[url]http://www.sigmaseven.net/price_check.php[/url]

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

[url]http://www.sigmaseven.net/zzf_cpu.php[/url]

Here is the code for this page:

[code=php]
<!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>
[/code]

Help would be awesome, Thanks!

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@JonaAug 24.2004 — [font=trebuchet ms]You can't [i]include[/i] remote files, that I know of, as that may allow remote connections to databases, etc. Try using readfile() instead.[/font]
Copy linkTweet thisAlerts:
@theuedimasterauthorAug 25.2004 — it still doesn't work... i don't know why
Copy linkTweet thisAlerts:
@MstrBobAug 25.2004 — 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.
Copy linkTweet thisAlerts:
@MstrBobAug 25.2004 — Instead of doing includes, you can use this:

[code=php]
<?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);
?>
[/code]
×

Success!

Help @theuedimaster spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...