Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    10
    Member #
    8426
    I have a website that is divided into 3 sections...a header (banner), a leftside (menu bar) and the main center section. I want to make a menu that when I click on one of the options, it opens a specific form in the main section.

    Right now I have one file called index.php (no php code in it...so it's basically a index.html). I divided using css and have the following code:

    <div id="top">
    <img src="web.gif" width="405" height="126" /></div>

    <div id="leftside">
    <?php
    include("sidebar.html");
    ?>
    </div>

    <div id="main">
    </div>

    Sidebar.html contains my menu and it is appearing properly. Within sidebar there is my links...how can I make them open in my main section? There are many menu options all with different types of forms and html pages that must open in the main section.

    All the stuff that will open in the main will be .php files.

    If you would like an idea of what I am trying to do...it is similar to this site:

    http://www.trader.ca/default.asp?fsa=Z9Z&ref=autotrader

    I want my menu bar, and header to act the same way as this site (always there)...and ideally not have to reload each time (to make the site quicker).

    How do I go about doing this? Sorry for the lenght.
    Thanks!

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    Welcome to the WDF! I can't remember the code exactly, but I think it's like the frame code for the same thing:

    <A HREF="http://www.cbs.com" TARGET="C">

    where C is the ID of the div you want the stuff to open into.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  4. #3
    Member
    Join Date
    Dec 2004
    Posts
    67
    Member #
    8452
    Liked
    1 times
    Quote Originally Posted by mikee30
    All the stuff that will open in the main will be .php files.
    This is pretty much how my site works. What you need to do is this:
    HTML Code:
    <div id="top">
    <img src="web.gif" width="405" height="126" /></div>
    
    <div id="leftside">
    <?php
    include("sidebar.html"); 
    ?> 
    </div>
    
    <div id="main">
    <?php include ($con); ?>
    </div>
    What I did there was I made the variable $con (or content). Now lets say this file is called index.php, annd you want to have the file content.php in the main div. You would write this URL:
    Code:
    http://www.mysite.com/index.php?con=content.php
    I hope this helps!
    -Monkey Squeakypants
    Brian : This must be the physics department.
    Chris : That explains all the gravity.

  5. #4
    Junior Member
    Join Date
    Dec 2004
    Posts
    10
    Member #
    8426
    Thanks for the replies guys, but it's still not working. Let me explain a little better.

    I have a index.php file that has <div id="main"> and <div id="leftside">. I also have another file called sidebar.php which is javascript code for the sidetoolbar which will go inside the "leftside". This is working.

    In the sidebar.php code, there are links which when clicked on, I need them to open in the div id = main section. How do I do this? Since they are 2 different files, does the sidebar.php know what div id main from the index.php file is? Do I need to include the sidebar.php file into the index.php somehow (like an include in c++)

    I've tried this code and it didn't work:
    <a href="search.php" TARGET="main" class="menulink";>Search</a>
    Search.php is what I want appearing in the main section.

    Any ideas?
    Thanks!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 04:30 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com