Tech Support Guy banner
Status
Not open for further replies.
1 - 16 of 16 Posts

·
Registered
Joined
·
37 Posts
Discussion Starter · #1 ·
Is there a way to make a website menu so that I don't have to change it on every page every time I want to add something?
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #3 ·
namenotfound said:
u could use a php include.

<?php include("menu.php");?>

then in a file called menu.php put ur menu there
I couldn't get it to work. Heres a sample page of my site layout

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Website Powered by Bravenet</title>
    <link rel="stylesheet" type="text/css" href="green_b.css">
</head>
<body>
<div class="wrapper">
	<div class="title titlemargin">My Website</div>

    <div class="left" style="font-weight: bold; margin: 5px; height: 100%; width: 150px;" align="center">
		<div class="sidebaritem first"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
	</div>
	
	<div class="border content padleft" style="padding-right: 20px;">
		<p class="title2">Welcome to Your New Website</p>
      	<p>Welcome to your new home on the Net!  If you don't have your own Domain Name yet, you can get one through your Hosting Manager.  Also in your Hosting Manager, you can find handy tools to maintain and update your Web Site, such as our Java-based FTP Applet, an easy way to upload your files to the server.</p>
       	<p>From the Hosting Manager you will also find links to our Web-based File Manager which includes a Text Editor and Visual Editor, making Site maintenance easy. And don't forget to check out the <a href="http://www.bravenet.com/resources/index.php">Resource Area</a> for HTML help, scripts, clip art, audio clips, fonts, and more!</p>
       	<p class="title2">Adding Fun Tools to Your Site</p>
       	<p>Through your Bravenet Account, you can choose many of our FREE Tools to enhance your Site.  Add as many as you like!  Get a Hit Counter, Guestbook, Message Board, Email Form, Minipoll, Web Journal, or any of Bravenet's other great <a href="http://www.bravenet.com/webtools/index.php">Tools and Services</a> to make your Site fun and interactive.</p>
     
	</div>
	<br style="clear: both;" />
	<div class="border footer"><a href="http://www.bravenet.com">Powered by Bravenet.com</a></div>
</div>
</body>
</html>
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #5 ·
so would I just take this part out

Code:
 <div class="left" style="font-weight: bold; margin: 5px; height: 100%; width: 150px;" align="center">
		<div class="sidebaritem first"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
		<div class="sidebaritem"><a href="">menu item</a></div>
and save as a "menu.php"
and put this were the menu used to be

Code:
<?php include("menu.php");?>
 

·
Registered
Joined
·
3,012 Posts
yes, so it would be like this:

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

	Website Powered by Bravenet

	My Website

  <?php include("menu.php");?>

Welcome to Your New Website

Welcome to your new home on the Net!  If you don't have your own Domain Name yet, you can get one through your Hosting Manager.  Also in your Hosting Manager, you can find handy tools to maintain and update your Web Site, such as our Java-based FTP Applet, an easy way to upload your files to the server.

From the Hosting Manager you will also find links to our Web-based File Manager which includes a Text Editor and Visual Editor, making Site maintenance easy. And don't forget to check out the [URL=http://www.bravenet.com/resources/index.php]Resource Area[/URL] for HTML help, scripts, clip art, audio clips, fonts, and more!

Adding Fun Tools to Your Site

Through your Bravenet Account, you can choose many of our FREE Tools to enhance your Site.  Add as many as you like!  Get a Hit Counter, Guestbook, Message Board, Email Form, Minipoll, Web Journal, or any of Bravenet's other great [URL=http://www.bravenet.com/webtools/index.php]Tools and Services[/URL] to make your Site fun and interactive.

	[URL=http://www.bravenet.com]Powered by Bravenet.com[/URL]
and in menu.php have this:

HTML:
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
		[URL]menu item[/URL]
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #7 ·
the menu isn't showing up
 

Attachments

·
Registered
Joined
·
721 Posts
Hi tjb,

Namenotfound's solution should work fine.

Is the path to the menu.php file correct? That is, if the menu.php file is sitting in the same folder as the other file, then the path is correct. If you have put the menu.php file into another folder such as includes, for instance, then the path to the menu.php file will have to reflect that.

Have tested the solution on my test server and it works correctly.

Hope this helps.
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #9 ·
deepdiver01 said:
Hi tjb,

Namenotfound's solution should work fine.

Is the path to the menu.php file correct? That is, if the menu.php file is sitting in the same folder as the other file, then the path is correct. If you have put the menu.php file into another folder such as includes, for instance, then the path to the menu.php file will have to reflect that.

Have tested the solution on my test server and it works correctly.

Hope this helps.
It's still not working. I have copyed and pasted the same codes that he posted and got nothing. Is there something I'm missing?
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #11 ·
Gibbs said:
If your testing locally do you have PHP installed? Or on your web server?
How would I know if I had PHP installed. I am uploading .htm files on to google pages
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #13 ·
Gibbs said:
Create an empty text file called "test.php" with just have the following in it:
PHP:
<?php
phpinfo();
?>
Save it (as test.php), upload it and view it.
I uploaded test.php and tryed to open it and it wanted me to save it to my computer.
Gibbs said:
If your going to use an include you must save BOTH pages as .php.
Do you mean save the pages as PHP files?
 

·
Registered
Joined
·
609 Posts
tjb said:
I uploaded test.php and tryed to open it and it wanted me to save it to my computer.
Doubt the server runs PHP then... Try see if you can view your hosting plan (specifications) and see if you have any server-side langauges installed.

tjb said:
Do you mean save the pages as PHP files?
Yes. If you want to use PHP you have to save them as PHP files (both of them).
 

·
Registered
Joined
·
37 Posts
Discussion Starter · #16 ·
I guess i'm not going to be able to do this :(
 
1 - 16 of 16 Posts
Status
Not open for further replies.
Top