Jump to content

Recommended Posts

http://bayarearcsociety.com/prototype/index.php

When I click the Home link in the nav panel I get these errors

 

Warning: include(/content/pages/testpage.php) [function.include]: failed to open stream: 
No such file or directory in /home/bayare27/public_html/prototype/content/maincontent.php on line 7

Warning: include() [function.include]: Failed opening '/content/pages/testpage.php' for 
inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/bayare27/php') in /home/bayare27
/public_html/prototype/content/maincontent.php on line 7

 

index.php

<!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" />
<meta http-equiv="Content-language" content="en" />
<link type="text/css" rel="stylesheet" href="css/reset.css"  />
<link type="text/css" rel="stylesheet" href="css/960.css"  />
<link type="text/css" rel="stylesheet" href="css/custom.css"  />
        <title></title>
</head>
    <body>
        <div id="wrapper" class="container_12">
            <div id="header" class="grid_12">
                <div id="left-header" class="grid_5 alpha"></div>
                <div id="newsflash" class="grid_7 omega"><?php include('content/newsflash.php'); ?></div>
            </div>
            <div id="leftmenu" class="grid_3"><?php include('content/menu.php'); ?></div>
            <div id="maincontent" class="grid_9"><?php include('content/maincontent.php'); ?></div>
            <div id ="footer" class="grid_12"><?php include('content/footer.php'); ?></div>
        </div><!-- end wrapper -->
    </body>
</html>

 

menu.php

<?php

?>
<div class="content">
<ul id="menu">
    <li><a href="<?php echo htmlentities($_SERVER['SCRIPT_NAME']); ?>?page=testpage"><span>Home</span></a></li>
<!-- Tried both these  $_SERVER['PHP_SELF'] and  $_SERVER['SCRIPT_NAME']-->
    <li><a href=""><span>About us</span></a></li>
    <li><a href=""><span>Schedule</span></a></li>
    <li><a href=""><span>Media</span></a></li>
    <li><a href=""><span>Products</span></a></li>
    <li><a href=""><span>Miscellaneous</span></a></li>
</ul>
</div>

 

testpage.php

<?php

?>
<p>
    lalalaa
</p>

 

The file structure on the server is:

 

prototype

content - I know these are ok

pages - testpage.php is in this file

css - I know these are ok

images - I know this one is ok

 

Just don't know what to do next.

 

Thanks

 

I apologize, I thought I was posting in php. I assume you will move it.

Link to comment
https://forums.phpfreaks.com/topic/228817-file-not-found-error/
Share on other sites

I apologize, I thought I was posting in php. I assume you will move it.

Yep ;)  And alternatively you can click on "Report to Moderator" in the bottom right to send a short message which all moderators will be able to view just in case some Mods don't venture into the particular section.

I won't say I fixed it but I got it to work.

 

Changed this

include('/content/pages/'.$_GET['page'].'.php');

to this

@include('pages/'.$_GET['page'].'.php');

Still don't know why the other did not work.

 

Am I in for trouble with what I have?

 

Thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.