Jump to content


Photo

php menu


  • Please log in to reply
9 replies to this topic

#1 leeutalkin2me

leeutalkin2me
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 10 April 2006 - 06:33 PM

Im designing a Travel website and want to get the homepage completed and tidied before i move onto the other pages.

I created a Menu using PHP and used the Include feature.
How do I determine where the actual Menu will open/load.
This is what the menu looks like on its own.
[a href=\"http://www.troublefreetraveladvisor.com/testingmenu.php\" target=\"_blank\"]http://www.troublefreetraveladvisor.com/testingmenu.php[/a]

I want it to open on this page, somewhere on the Left hand side of the page. the table is labelled - id=navigation
[a href=\"http://www.troublefreetraveladvisor.com/try5.html\" target=\"_blank\"]http://www.troublefreetraveladvisor.com/try5.html[/a]

I know the html of the menu itself is very poor, thats something I am trying to work out how to change, as im using dreamweaver, when i open up the testingmenu.php page, in design view i cannot change anything. even the actual menu file,only the Coding view is accessible

Any help to get me moving?

#2 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 10 April 2006 - 06:41 PM

If your table layout has a cell on the very left where you would like your navigation menu to be then just put your include inside the empty cell.

<? include ('navigation.php'); ?>


#3 leeutalkin2me

leeutalkin2me
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 10 April 2006 - 06:50 PM

[!--quoteo(post=363388:date=Apr 10 2006, 07:41 PM:name=freakus_maximus)--][div class=\'quotetop\']QUOTE(freakus_maximus @ Apr 10 2006, 07:41 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
If your table layout has a cell on the very left where you would like your navigation menu to be then just put your include inside the empty cell.

<? include ('navigation.php'); ?>
[/quote]




so in my try5.html page, there is a table cell
<td width="149" class="pageName"> </td>

do i put this in there - <? include ('navigation.php'); ?>

I dont have a file called navigation.php thats whats confused me.

#4 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 10 April 2006 - 07:46 PM

I do not know what you named your navigation or menu file that your calling. I was using "navigation.php" as an example. Take a look at this, should help:

If your table is something like this: (this is what I do so I can be sure to place things where I want that are common across all pages).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </head>
    <body>
        <TABLE id="Table1" style="WIDTH: 750px; HEIGHT: 584px" cellSpacing="1" cellPadding="1"
            width="750" border="1">
            <TR>
                <TD colSpan="3">
                    <P align="center">This is where I put my logo or whatever I want on the top of each 
                        page.</P>
                </TD>
            </TR>
            <TR>
                <TD style="WIDTH: 60px; HEIGHT: 506px">put navigation include here</TD>
                <TD style="HEIGHT: 506px" width="400" colSpan="2">This is the body or where 
                    information for each specific page would be.</TD>
            </TR>
            <TR>
                <TD colSpan="3">
                    <P align="center">This is where I put my copyrights or whatever I want on 
                        the bottom of each page.</P>
                </TD>
            </TR>
        </TABLE>
    </body>
</html>

You can replace the 'dummy text' with your actual includes like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </head>
    <body>
        <TABLE id="Table1" style="WIDTH: 750px; HEIGHT: 584px" cellSpacing="1" cellPadding="1"
            width="750" border="1">
            <TR>
                <TD colSpan="3">
                    <P align="center"><? include ('top.php'); ?>
                        page.</P>
                </TD>
            </TR>
            <TR>
                <TD style="WIDTH: 60px; HEIGHT: 506px"><? include ('menu.php'); ?></TD>
                <TD style="HEIGHT: 506px" width="400" colSpan="2">This is the body or where 
                    information for each specific page would be.</TD>
            </TR>
            <TR>
                <TD colSpan="3">
                    <P align="center">T<? include ('bottom.php'); ?></P>
                </TD>
            </TR>
        </TABLE>
    </body>
</html>

If your still having a problem post your code for us so we can get a little more specific with what you have.

#5 leeutalkin2me

leeutalkin2me
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 10 April 2006 - 08:29 PM

I tried this but no luck. just adding the line about include menu.


<tr>
    <td width="149" height="881" valign="top" bgcolor="#E6F3FF"><table width="149" border="0" cellpadding="0" cellspacing="0"  class="pageName" id="navigation">
      <tr>
        <td width="149" class="pageName"><? include ('menu.php'); ?></td>
  
      </tr>
      <tr class="pageName">
        <td width="149" class="pageName"> </td>
      </tr>
      <tr>
        <td width="149" class="pageName"> </td>
      </tr>
      <tr>
        <td width="149" class="pageName"> </td>
      </tr>
      <tr>
        <td width="149" class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      <tr>
        <td class="pageName"> </td>
      </tr>
      
    </table>


#6 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 11 April 2006 - 12:29 PM

[!--quoteo(post=363431:date=Apr 10 2006, 04:29 PM:name=leeutalkin2me)--][div class=\'quotetop\']QUOTE(leeutalkin2me @ Apr 10 2006, 04:29 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I tried this but no luck. just adding the line about include menu.
<td width="149" class="pageName"><? include ('menu.php'); ?></td>
[/quote]


Is 'menu.php' the name of your menu file? Is it at the same location as your index page?

What happens when you run this, do you get get an error? Does anything display?

#7 Yesideez

Yesideez
  • Members
  • PipPipPip
  • Advanced Member
  • 2,334 posts
  • LocationDevon, UK

Posted 11 April 2006 - 01:20 PM

Howdy, just been reading through and I know what you're trying to achieve. Have your menu called something like menu.php and be something like this:
<table cellspacing="0" cellpadding="0" border="0">
<tr><td><a href="file1.php">Option 1</a></td></tr>
<tr><td><a href="file2.php">Option 2</a></td></tr>
<tr><td><a href="file3.php">Option 3</a></td></tr>
</table>
Each file that you want to have the menu will have to be a PHP file and be something like this:
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<?php include("menu.php"); ?>
</td>
<td valign="top">
blah blah blah
</td>
</tr>
</table>
The "blah blah blah" bit would be the contents of each page. Basically this is making a table inside a table. The valign tags make sure the menu and each page appear at the top. If you ever get stuck, turn one or both of the borders on (set to 1) in the "table" tags to see where the boundaries are.

Each file "file1.php", "file2.php", file3.php" and so-on would have the second piece of code in to add the menu its just the "blah blah blah" bit that would be different for each page.
Not a pro just an enthusiast :)

if (empty($coffee)) {$coffee=new coffee();}

Please surround any code using the CODE tags - I rarely look at anything without them

#8 leeutalkin2me

leeutalkin2me
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 11 April 2006 - 06:36 PM

yey it was a simple thing, i hadnt renamed one page .php. so did that and some tweaking and its at least opening in the right place and i made it match the current table size

[a href=\"http://www.troublefreetraveladvisor.com/try5.php\" target=\"_blank\"]http://www.troublefreetraveladvisor.com/try5.php[/a]

Viewing thru firefox the links etc is small

Where do i need to code to be able to change the Font/Size etc of the Link?

in the menu.inc , try5.php
I deleted the size inthe .css file as it was making everything in a TD code change size.

How do i change the size?

As now I want to work on the Design of the Menu?



#9 leeutalkin2me

leeutalkin2me
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 13 April 2006 - 08:50 PM

any ideas
?

#10 jcbarr

jcbarr
  • Members
  • PipPipPip
  • Advanced Member
  • 219 posts

Posted 14 April 2006 - 09:32 PM

Start with your HTML coding problems.

[a href=\"http://validator.w3.org/check?uri=http%3A%2F%2Fwww.troublefreetraveladvisor.com%2Ftry5.php\" target=\"_blank\"]http://validator.w3.org/check?uri=http%3A%....com%2Ftry5.php[/a]

This should probably be moved to the HTML help. The PHP side of things are finished, not its just learing HTML that is hanging you up.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users