Jump to content

include error


WatsonN

Recommended Posts

I have the code:

<?php
if ($_GET['id'] == "24") {
$page = "/24/";
} elseif ($_GET['id'] == "35") {
$page = "/35/html/index.html";
} elseif ($_GET['id'] == "36") {
$page = "/36/html/index.html";
} elseif ($_GET['id'] == "46") {
$page == "/46/index.html";
} elseif ($_GET['id'] == "263") {
$page = "/263/index.html";
} else {
$page = "welcome.php";
}
?>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Page Preview - Nathan Watson</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<?php
include("x.php");
include($page);
?>

 

but when I use an id it gives me the error

Warning: include(/263/index.html) [function.include]: failed to open stream: No such file or directory in /home/content/n/a/t/nathanwatson/html/projects/index.php on line 23

Warning: include() [function.include]: Failed opening '/263/index.html' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/n/a/t/nathanwatson/html/projects/index.php on line 23

 

And I have absolutely no idea why

Link to comment
https://forums.phpfreaks.com/topic/216320-include-error/
Share on other sites

using full paths i get the error

Warning: include(/home/content/n/a/t/nathanwatson/html/projects/24/) [function.include]: failed to open stream: Inappropriate ioctl for device in /home/content/n/a/t/nathanwatson/html/projects/index.php on line 23

Warning: include() [function.include]: Failed opening '/home/content/n/a/t/nathanwatson/html/projects/24/' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/n/a/t/nathanwatson/html/projects/index.php on line 23

Link to comment
https://forums.phpfreaks.com/topic/216320-include-error/#findComment-1124200
Share on other sites

I tried to use curl and it will output the file but is it possible to to make it post the images and css?

<?php
if ($_GET['id'] == "templates") {
$page = "templates.php";
} elseif ($_GET['id'] == "24") {
$page = "http://proj.WatsonN.com/templates/24/html/";
} elseif ($_GET['id'] == "35") {
$page = "http://proj.WatsonN.com/templates/35/html/index.html";
} elseif ($_GET['id'] == "36") {
$page = "http://proj.WatsonN.com/templates/36/html/index.html";
} elseif ($_GET['id'] == "46") {
$page = "http://proj.WatsonN.com/templates/46/index.html";
} elseif ($_GET['id'] == "263") {
$page = "http://proj.WatsonN.com/templates/263/index.html";
} elseif ($_GET['id'] == "brownstone") {
$page = "http://proj.WatsonN.com/templates/brownstone/";
} elseif ($_GET['id'] == "zionnarrow") {
$page = "http://proj.WatsonN.com/templates/zionanrrow/";
} elseif ($_GET['id'] == "assiduous") {
$page = "http://proj.WatsonN.com/templates/assiduous/";
} elseif ($_GET['id'] == "bedazzled") {
$page = "http://proj.WatsonN.com/templates/bedazzled/";
} elseif ($_GET['id'] == "boosting") {
$page = "http://proj.WatsonN.com/templates/boosting/";
} elseif ($_GET['id'] == "cellulose") {
$page = "http://proj.WatsonN.com/templates/cellulose/";
} elseif ($_GET['id'] == "component") {
$page = "http://proj.WatsonN.com/templates/component/";
} elseif ($_GET['id'] == "concurrence") {
$page = "http://proj.WatsonN.com/templates/concurrence/";
} elseif ($_GET['id'] == "customary") {
$page = "http://proj.WatsonN.com/templates/customary/";
} elseif ($_GET['id'] == "familiar") {
$page = "http://proj.WatsonN.com/templates/familiar/";
} elseif ($_GET['id'] == "gestured") {
$page = "http://proj.WatsonN.com/templates/gestured/";
} elseif ($_GET['id'] == "implied") {
$page = "http://proj.WatsonN.com/templates/implied/";
} elseif ($_GET['id'] == "indicator") {
$page = "http://proj.WatsonN.com/templates/indicator/";
} elseif ($_GET['id'] == "lilypads") {
$page = "http://proj.WatsonN.com/templates/lilypads/";
} elseif ($_GET['id'] == "offlimits") {
$page = "http://proj.WatsonN.com/templates/offlimits/";
} elseif ($_GET['id'] == "offrecord") {
$page = "http://proj.WatsonN.com/templates/offrecord/";
} elseif ($_GET['id'] == "reckoning") {
$page = "http://proj.WatsonN.com/templates/reckoning/";
} elseif ($_GET['id'] == "refresh") {
$page = "http://proj.WatsonN.com/templates/refresh/";
} elseif ($_GET['id'] == "smallwindow") {
$page = "http://proj.WatsonN.com/templates/smallwindow/";
} elseif ($_GET['id'] == "solutions") {
$page = "http://proj.WatsonN.com/templates/solutions/";
} elseif ($_GET['id'] == "soothing") {
$page = "http://proj.WatsonN.com/templates/soothing/";
} elseif ($_GET['id'] == "substantial") {
$page = "http://proj.WatsonN.com/templates/substantial/";
} elseif ($_GET['id'] == "wellness") {
$page = "http://proj.WatsonN.com/templates/wellness/";
} elseif ($_GET['id'] == "woodenly") {
$page = "http://proj.WatsonN.com/templates/woodenly/";
} elseif ($_GET['id'] == "equivalency") {
$page = "http://proj.WatsonN.com/templates/equivalency/";

} else {
$page = "welcome.php";
}

if ($_GET['id'] == "templates") { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Template Preview - Nathan Watson</title>
<meta name="keywords" content="xhtml css free templates layouts" />
<link rel="stylesheet" type="text/css" href="style.css" /></head>
<body>
<div id="header_lite">
<div id="header_inner_lite" class="fluid">
<div id="logo">
<a href="http://proj.WatsonN.com/">
<img src="images/logo.gif" alt="Nathan Watson inc." /></a>
</div>
<div id="menu">
<ul>
<li><a href="mailto:[email protected]">E-mail Nathan</a></li>
</ul>
</div>
</div>
</div>
<a href="?id=24">24</a><br>
<a href="?id=35">35</a><br>
<a href="?id=36">36</a><br>
<a href="?id=46">46</a><br>
<a href="?id=263">263</a><br>
<a href="?id=brownstone">brownstone</a><br>
<a href="?id=zionnarrow">zionnarrow</a><br>
<a href="?id=assiduous">assiduous</a><br>
<a href="?id=bedazzled">bedazzled</a><br>
<a href="?id=boosting">boosting</a><br>
<a href="?id=cellulose">cellulose</a><br>
<a href="?id=component">componet</a><br>
<a href="?id=concurrence">concurrence</a><br>
<a href="?id=customary">customary</a><br>
<a href="?id=familiar">familiar</a><br>
<a href="?id=gestured">gestured</a><br>
<a href="?id=implied">implied</a><br>
<a href="?id=indicator">indicat</a><br>
<a href="?id=lilypads">lilypads</a><br>
<a href="?id=offlimits">offlimits</a><br>
<a href="?id=offrecord">offrecord</a><br>
<a href="?id=reckoning">reckoning</a><br>
<a href="?id=refresh">refresh</a><br>
<a href="?id=smallwindow">smallwindow</a><br>
<a href="?id=solutions">solutions</a><br>
<a href="?id=soothing">soothing</a><br>
<a href="?id=substantial">substantial</a><br>
<a href="?id=wellness">wellness</a><br>
<a href="?id=woodenly">woodenly</a><br>
<a href="?id=equivalency">equivalency</a><br>
</body>
</html>
<?php
} elseif (isset($_GET['id'])) { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Project Preview ~ Nathan Watson</title>
<link rel="stylesheet" type="text/css" href="/style.css" />
</head>
<?php
include ("x.php");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $page);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
</html>
<?
} else { ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Template Preview - Nathan Watson</title>
<meta name="keywords" content="xhtml css free templates layouts" />
<link rel="stylesheet" type="text/css" href="style.css" /></head>
<body>
<div id="header_lite">
<div id="header_inner_lite" class="fluid">
<div id="logo">
<a href="http://proj.WatsonN.com/">
<img src="images/logo.gif" alt="Nathan Watson inc." /></a>
</div>
<div id="menu">
<ul>
<li><a href="mailto:[email protected]">E-mail Nathan</a></li>
</ul>
</div>
</div>
</div>
<center>
<h1>Please use the link provided to you to access these pages</h1>
<br><br><br>
<h3>
<a href="http://WatsonN.com" target="top">Nathan Watson</a>
</h3>
</center>
</body>
</html>
<?php 
}
?>

I'm just trying to avoid iframes, as I hate them.

Link to comment
https://forums.phpfreaks.com/topic/216320-include-error/#findComment-1127345
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.