Jump to content

PHP help


Recommended Posts

I have no idea what is wrong, i am trying to include a file for a menu

name

 

menu.inc

 

i use this script

 

 

CODE

<?php include(menu.inc& #41;; ?>

 

 

 

and all i get is

 

 

CODE

Warning: main(menuinc) : failed to open stream: No such file or directory in /customers/swift-crea tions.com/swift-creat ions.com/httpd.www/cl an/index.php on line 38

 

Warning: main(): Failed opening 'menuinc' for inclusion (include_path= 9;.:/usr/lib/php& #39;) in /customers/swift-crea tions.com/swift-creat ions.com/httpd.www/cl an/index.php on line 38

 

 

 

Any help please??

 

An Include Example

Say we wanted to create a common menu file that all our pages will use. For easy reference, files that are to be included usually are named with a ".inc" extension. Since we want to create a common menu, let us save it as "menu.inc".

 

menu.inc Code:
<html> <body>
<a href="index.php">Home</a> - 
<a href="about.php">About Us</a> - 
<a href="links.php">Links</a> - 
<a href="contact.php">Contact Us</a> <br /> 

 

Save the above file as "menu.inc". Now create a new file, "index.php" in the same directory as "menu.inc". Here we will take advantage of the include function to add our common menu.

 

i got this from

http://www.tizag.com/phpT/include.php

 

I want a menu that i can link to other pages on my site, but i want to have only one file that i need to edit, so i dont need to edit everypage, when i add a new page to the site. I Also want to have it so i can instead of having many pages, just have includes on the page.

 

Help me please

 

Thanks

Link to comment
Share on other sites

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.