You are here: Re: Menu on the left or on the right « HTML « IT news, forums, messages
Re: Menu on the left or on the right

Posted by Deryck on 08/22/06 06:26

Luigi Donatello Asero wrote:

>> This doesn't answer your question but....
>>
>> You could use 2 CSS stylesheets (one for left, one for right) and some
>> bit of code (involving PHP and cookies) to let the user select which
>> one he preferred.
>
> How would I do that?
> I am not so good at PHP.
>
>

OK, something like this...

0) check that your wbhosting company lets you have PHP
1) convert html files to PHP (change the .html extension to .php)
2) update all internal links in the files you just changed to look
file.php rather than file.html

At this stage the site should now work as before

3) Make life easier for yourself by putting all code that gets repeated
(doctype, css, navigation menu, etc) at the start and end of each file
into separate files called, say header.inc and footer.inc

4)Now use PHP to include those files rather than having the code itself
in each file. Your newly converted html to php files will look something
like
<?php require ("header.inc") ?>
<p> Main web content here </p>
<?php require ("footer.inc") ?>

At this stage the site should now work as before

5)Create the 2 stylesheet files to position the menu on the left and
right sides. Test each.

6)Google for styleswitcher.php. I can't remember where I got the source
for my site from but
http://www.gr0w.com/articles/code/css_stylesheet_switcher_using_php_javascript_free/
will probably work OK.

7)Add this code to header.inc

8) Try it.

9)Debug it :)

Thats the summary of how to do it. Post again whe- if you get stuck.

Hope that helps,


Deryck

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация