|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 12
|
|
| Author |
|
|
Stranger Joined: Oct 20, 2008 Post Count: 5 Status: Offline |
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 |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
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 |
||
|
|
Advanced Member UK Joined: Sep 17, 2007 Post Count: 590 Status: Offline |
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. |
||
|
|
Stranger Joined: Oct 20, 2008 Post Count: 5 Status: Offline |
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. |
||
|
|
Advanced Member USA Joined: Nov 27, 2003 Post Count: 6285 Status: Offline |
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] |
||
|
|
Stranger Joined: Oct 20, 2008 Post Count: 5 Status: Offline |
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 |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
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 |
||
|
|
Stranger Joined: Oct 20, 2008 Post Count: 5 Status: Offline |
Yes that clears it up, thanks a lot! |
||
|
|
Advanced Member USA Joined: Mar 24, 2005 Post Count: 3000 Status: Offline |
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 |
||
|
|
Stranger Joined: Oct 20, 2008 Post Count: 5 Status: Offline |
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] |
||
|
|
|
|
|
Current timezone is GMT Sep 5, 2010 10:02:01 PM |