+ Reply to Thread
Results 1 to 5 of 5

Thread: Change once, changee all...

  1. #1
    bigtree's Avatar
    bigtree is offline x10Hosting Member bigtree is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Canada
    Posts
    82

    Change once, changee all...

    I'm trying to make it so that I can edit my menu in a seperate file and have it change in all my pages. I don't want to use frames. For example, my menu is in every page, and in the script for the pages it says something like <script source="blah"> type thing, and when I change the "blah" file, it changes the menu on all the pages... Is this possible? Does this even make sense?
    Edit:
    Oh, come on, there has to be some solution!
    Last edited by bigtree; 10-20-2008 at 11:18 PM. Reason: Automerged Doublepost

  2. #2
    xmakina's Avatar
    xmakina is offline x10 Lieutenant xmakina is an unknown quantity at this point
    Join Date
    May 2008
    Location
    England
    Posts
    265

    Re: Change once, changee all...

    What you want is PHP include or require. These commands allow you to place one file into another.

    Example: You want a standard header and title in every page:

    Put in your page:
    PHP Code:
    <?php
    include("title.php");
    ?>
    Then create a file called "title.php" (for this example at least) and place in it the code you want where the include is. In our case it's:
    HTML Code:
    <title>My Website</title>
    IF($this->$post.content() == "SEE SIG"){
    w3Schools and Google
    }

  3. #3
    quantum1's Avatar
    quantum1 is offline x10Hosting Member quantum1 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    Re: Change once, changee all...

    Is your menu straight HTML or does it include <?php ?> tags, also? Also, does it contain javascript or references to javascript that is dependent on tag names or ids?

  4. #4
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: Change once, changee all...

    yes you can do that. with javascript and/or php depending if you have the actual script already.

    judging by what you actually typed I am assuming you have an existing javascript menu, is this right? You will have to write the whole menu and save it into one file e.g. blah. then include it to your html using <script type='text/javascript' src='blah'></script> I am not quite sure but I think in javascript you will use document.write("menu code") to the insert your menu to your page.

    but if you are asking for opinion php will work easiest. Create your php menus. and just use include 'blah.php'; and you are all set.
    Edit:
    if you want a pure css - html dropdown menu I can also help you with that.
    Last edited by dickey; 10-22-2008 at 01:38 AM. Reason: Automerged Doublepost

  5. #5
    bigtree's Avatar
    bigtree is offline x10Hosting Member bigtree is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Canada
    Posts
    82

    Re: Change once, changee all...

    I tried the php includem thing and...
    It works! Merci!
    Last edited by bigtree; 10-22-2008 at 09:12 PM.

+ Reply to Thread

Similar Threads

  1. 5 Ways to Change Password
    By manzoor in forum Tutorials
    Replies: 8
    Last Post: 12-04-2007, 02:26 PM
  2. change forum name
    By Spartan Erik in forum Free Hosting
    Replies: 1
    Last Post: 02-06-2006, 07:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers