Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 12
Posts: 12   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 6152 times and has 11 replies Next Thread
Male FireDart
Stranger
Member's Avatar


Joined: Oct 20, 2008
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Make a CSS menu bar that like <?php include("menu.php"); ?>

Hi,

I am looking to make a menu bar that works like <?php include("menu.php"); ?> but with css instead. I want to be able to edit the info(what you see in the menu bar link names, links, color, etc.) in a separate file.

I don't want to use <?php include("menu.php"); ?> because it makes you have the file name with .php at the end and some code am using does not like the .php file.

Can this be done with css? How do big sites like eBay, CNN, amazon, etc. edit many pages with out copying and pasting code? I hear they use lot's of code, that include javascript(don't want to use javascripy either)

Any help would be very appreciated,
FireDart

[Oct 20, 2008 8:49:33 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male falkencreative
Advanced Member
Member's Avatar

USA
Joined: Aug 14, 2007
Post Count: 1129
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

CSS is good for some things, but you can't make it take the place of a dynamic language like PHP. CSS is for styling existing content only. If you want to have a separate file for the menu, you'll need to use a PHP or ASP include (which means your files will have to end in .PHP or .asp).

Amazon or those other big sites probably have a very large content management system they are using to keep track of that for them. Content Management Systems, like CMSMadeSimple, Wordpress, Joomla, etc. often take care of page creation/content editing, but all use some sort of dynamic language like PHP, ASP, etc.
----------------------------------------
Benjamin Falk | student : designer : developer
Twitter: falkencreative
[Oct 20, 2008 11:01:56 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male Wickham
Advanced Member
Member's Avatar

UK
Joined: Sep 17, 2007
Post Count: 590
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

You can also use SHTML instead of PHP or ASP; it works the same way with an "include" file, but main files end in .shtml instead of .html.

If you can't use PHP you may not be able to use SHTML but it's worth trying.

See http://www.wickham43.net/serversideincludes.shtml
----------------------------------------
Code downloaded to my PC will be deleted in due course.
WIN XP SP3; IE7, Firefox 3.0, Opera and Safari for Windows; screen resolution usually 1024x768.
IE6 on W98 with 800*600.
[Oct 21, 2008 1:04:33 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male FireDart
Stranger
Member's Avatar


Joined: Oct 20, 2008
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

Ok, thanks for the info. Do you know of and open source content management system? If not I will try the asp, or shtml and see what I get.
[Oct 21, 2008 7:20:44 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male LSW
Advanced Member
Member's Avatar

USA
Joined: Nov 27, 2003
Post Count: 6285
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

ASP only runs on a windows server, not Linux/Apache server. (not quite true, there is said to be a plugin... but not worth messing with. PHP, Perl, Python... most languages are for Linux. That said, the .NET framework for windows does in fact support these languages too now, but you have to use .NET. I have not messed with PHP.NET yet...)

The file to be included doe snot need to be .php or anything else. It can be .txt or generally .inc is used to designate it as a file that will be included in another page.

Otherwise you use CSS as usual, before the styles are added that section of code will be part of the page... so just use CSS as you would on a solid page. Your include will be included by that point.

CMS (Content Management System) : Accessibility
----------------------------------------
[Edit 1 times, last edit by LSW at Oct 21, 2008 9:33:41 AM]
[Oct 21, 2008 9:31:11 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male FireDart
Stranger
Member's Avatar


Joined: Oct 20, 2008
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

The file to be included doe snot need to be .php or anything else. It can be .txt or generally .inc is used to designate it as a file that will be included in another page.

LSW so you are saying instead of doing
<?php include("menu.php"); ?>

I could do
<?php include("menu.txt"); ?>
or
<?php include("menu.inc"); ?>

and it would work just like <?php include("menu.php"); ?> ? Do i need to change the the <?php include("menu.inc"); ?> to something like
<?txt include("menu.txt"); ?>
or
<?inc include("menu.inc"); ?>

Thanks for the feed back so far,
FireDart
[Oct 21, 2008 3:40:43 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male falkencreative
Advanced Member
Member's Avatar

USA
Joined: Aug 14, 2007
Post Count: 1129
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

The file to be included doe snot need to be .php or anything else. It can be .txt or generally .inc is used to designate it as a file that will be included in another page.

LSW so you are saying instead of doing
<?php include("menu.php"); ?>

I could do
<?php include("menu.txt"); ?>
or
<?php include("menu.inc"); ?>

Yes


and it would work just like <?php include("menu.php"); ?> ?

Yes


Do i need to change the the <?php include("menu.inc"); ?> to something like
<?txt include("menu.txt"); ?>
or
<?inc include("menu.inc"); ?>

No, you wouldn't need to change it to <?txt or <?inc -- that won't work.

You can do all of this... but in the end, the file that you have the php include code in (<?php include("menu.inc"); ?>) will need to end in .php for it to work properly. The included file can be named just about anything, so it can end in .inc, .txt, whatever.

Hopefully that's clear enough.
----------------------------------------
Benjamin Falk | student : designer : developer
Twitter: falkencreative
[Oct 21, 2008 6:38:24 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male FireDart
Stranger
Member's Avatar


Joined: Oct 20, 2008
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

Yes that clears it up, thanks a lot!
[Oct 21, 2008 6:51:34 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male shelfimage
Advanced Member
Member's Avatar

USA
Joined: Mar 24, 2005
Post Count: 3000
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

Be careful about using a .txt extension to name your include file. For example. menu.inc instead of menu.php.

If you have any information in the .inc or .txt file, it will be visible as a text file in a browser if someone guesses the name of the include file. Using .php will prevent the file from being read as text.

For example, let's say you have a database connection and you are in the practice of ending your includes in .inc.

connect.inc includes your database user name, password, etc. If someone maliciously decides to poke around and happens upon http://your-site/includes/connection.inc, they will see the details of the file as a text file in the browser. Your database will be compromised.

Not a big problem if they see your menu as text in your case, but food for thought and how to approach this using best practices.
----------------------------------------
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
Save the developers<!>
Maine Webworks
[Oct 21, 2008 7:39:15 PM] Show Printable Version of Post    View Member Profile    Send Private Message    mainewebworks    mainewebworks [Link] Report threatening or abusive post: please login first  Go to top 
Male FireDart
Stranger
Member's Avatar


Joined: Oct 20, 2008
Post Count: 5
Status: Offline
Reply to this Post  Reply with Quote 
Re: Make a CSS menu bar that like <?php include("menu.php"); ?>

ok, is my best beat just to figure out what I want on my menu and stick with it and hope I don't need to ad anything?

One last thing,
How can you make one of those pages that change the content only but keeps the everything else the same but will changes the url name too? While this do about the same thing that am trying to do? or is it something totally different and should not even try it?

Thanks for all the feed back thought still looking at my options but it's nice that I know have lot's of them.
----------------------------------------
[Edit 1 times, last edit by FireDart at Oct 21, 2008 8:03:27 PM]
[Oct 21, 2008 7:48:15 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 12   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread