Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

PHP menu - drop down menu


  • Please log in to reply

#1
glen_m_32

glen_m_32

    Member

  • Member
  • PipPipPip
  • 255 posts
Hi,

can someone help me with some PHP or whateva i need,

i have a website at http://www.cutzbothwayz.co.uk and want the some of the menu (products and prices) to have a menu which expands out to show the other options (the ones that are on the relative pages already).

my php for the menu at the mo is:

$menu = array("home.php"=>array("title"=>"Cutz Both Wayz - Homepage","menutip"=>"Please visit the Homepage","LinkText"=>"Home"),"openingtimes.php"=>array("title"=>"Cutz Both Wayz - Opening Times","menutip"=>"To see our opening times","LinkText"=>"Opening Times"),"staff.php"=>array("title"=>"Cutz Both Wayz - Staff","menutip"=>"Our team","LinkText"=>"Staff"),"pricemenu.php"=>array("title"=>"Cutz Both Wayz - Prices","menutip"=>"Our full price list","LinkText"=>"Prices"),"products.php"=>array("title"=>"Cutz Both Wayz - Products","menutip"=>"To see our products available for purchase","LinkText"=>"Products"),"album.php"=>array("title"=>"Cutz Both Wayz - Photos","menutip"=>"Photo Album","LinkText"=>"Photo Album"),"promotions.php"=>array("title"=>"Cutz Both Wayz - Promotions","menutip"=>"Visit our promotions","LinkText"=>"Promotions"),"testimonials.php"=>array("title"=>"Cutz Both Wayz - Guestbook","menutip"=>"Enjoyed your visit, Leave us some feedback","LinkText"=>"Guestbook"),"findingus.php"=>array("title"=>"Cutz Both Wayz - Finding Us","menutip"=>"To get directions please go here","LinkText"=>"Finding Us"));

and css code looks like:

#menu{	position: absolute;	left: -2px;	top: 110px;		width: 150px;	padding:60px 15px 10px 10px;	z-index: 20;}#menu a {	width: 130px;	height: 20px;	text-align: center;	text-transform: capitalize;	padding: 5px 0px 0px 0px;	background: url('/images/buttons/acbutt.gif') no-repeat;	font-family: veranda, arial, "times new roman";	Font-size: 12px;	font-weight: bold;	color: #000000;	border-style:groove;	border-color: #000002;	border-width:1px;	margin: 2px;}#menu a:hover {	background: url('/images/buttons/overbutt.gif') no-repeat;}

any help is greatly appreciated!

i'm kinda new to PHP!

thanks for your help in advanced!

Glen
  • 0

Advertisements


#2
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
PHP will not help you here, it could even make it a lot harder. PHP is as you should know used to generate HTML, if it outputs the same HTML every time, it better to just use the HTML to start with. Maybe even better if you put the menu in a php include and then include it in every page.

Your trying to do something like http://www.cssplay.c...us/flyoutt.html I guess. I would follow that example.

EDIT: The menu you are useing also looks a mess in Firefox, useing the example should fix that.

Edited by Michael, 30 November 2006 - 08:52 PM.

  • 0

#3
glen_m_32

glen_m_32

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 255 posts
Thats exactly what i'm after,

What actally happens to the menu in firefox?

Thank you so much for your help, i'm kinda new to webdesign and that my first attempt at a full website!

I will post an update as soon as i update the menu! Thanks for your help again!
  • 0

#4
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
Your welcome!

In Firefox the menu get squashed so you can't read it. I recommend you get Firefox or some other browser like Opera to test your pages in as well as IE.
  • 0

#5
glen_m_32

glen_m_32

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 255 posts
S o could you advise me on the best way to sort it for now, i've never come across firefox (will download it when i get home).

What part of css does firefox not support?

Sorry my insolence
  • 0

#6
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
:whistling:

Firefox supports far more CSS that IE does. But IE has some nonstandard ways of displaying things. Chances are if you code a website in IE it going to look right only in IE. Code it in Firefox or something else like that and it will work in everything most of the time, with the odd touch up for IE. You see there is such this as The World Wide Web Consortium (W3C) every one is supposed to follow the standards they set and IE is the worst when it comes to following them. W3C is headed my the inventor of HTML btw.

You soon join the club of web developers that always tear there hair out trying to get things to work in IE :blink:

You can get Firefox from http://www.getfirefox.com/

Firefox also has a lot of neat features, and you can get more as extensions form http://addons.mozilla.org/ I am an extension developer myself.

Edited by Michael, 01 December 2006 - 02:14 AM.

  • 0

#7
glen_m_32

glen_m_32

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 255 posts
:blink:

Thats some interesting fact i did not know! but indeed i am pulling my hair out over it! the way it is now, is not professional enough!

Because i'm generating my code using an array in PHP would it be a problem making one or two of the menu items to be the flyout menus but leave the rest? :whistling:

you seem a good guy to know :help:

FYI please ignore the link in my signature, i'm currently updating it!

Edited by glen_m_32, 01 December 2006 - 02:23 AM.

  • 0

#8
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
I carefully examined the signature. Needs some work.

You can put an array with in an array. But what is the point? Your getting the same code produced every time, may as well just write it out. I always put my menus in a php include like this
include('menu.php');
Well I do whole top of the page right up to were the content starts like that using variables to change the title on each page. And same goes for the footer.

I a down right pest to know. I going to make you install some Firefox extension soon. Such as https://addons.mozilla.org/firefox/60/ and https://addons.mozil...rg/firefox/249/
Let alone the fact you don't have a doctype. Which is supposed to be the very first thing in a HTML document.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
is what it looks like.

Now back to reading the CSS 2.1 Specification :whistling:

Edited by Michael, 01 December 2006 - 05:43 AM.

  • 0

#9
glen_m_32

glen_m_32

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 255 posts
:blink: now look what happens in IE, maybe abit like firefox!

I'll definatly install firefox and them add on's tonigh when i get home from work. You know what, i completely forgot about the doctype thingy! :whistling:

oh well we all need to start from somewhere!

Thanks once again, i'll look at the CSS to sort it ASAP!then i'll worry about the newer funkier menu!
  • 0

#10
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts

oh well we all need to start from somewhere!


And you don't even want to know what my first try was like... :whistling:

Good luck with it.
  • 0

#11
glen_m_32

glen_m_32

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 255 posts
i have now hard coded the menu into my index, no php generated menu now :whistling: !

Thanks for all your help, just the css to sort now then the new parts to the menu!

Edited by glen_m_32, 01 December 2006 - 06:19 AM.

  • 0

#12
glen_m_32

glen_m_32

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 255 posts
i've installed FF and the addon's you linked, Its v simular to IE7.

:blink:

Ain't had time for CSS yet, but it will be done! ASAP!

thanks for all your help once again!

:whistling:
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP