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 7 of 7
  1. #1
    Banned
    Join Date
    May 2011
    Location
    Fairfax, CA
    Posts
    2,036
    Member #
    28003
    Liked
    126 times
    OK, so I made the website http://psudatabase.com/
    now, here's the thing. I want to put something on the bottom half of that sidebar that has dropdown menus where you choose a brand, series, and model, that then sends you to a certain product page.
    like http://www.crucial.com/index.aspx
    see what I mean?
    I also need an easy way to add pages.
    So here's the thing:
    I only want the content in that middle white space where it says Coming soon! to change to the product page. Everything else needs to stay the same.
    And something with some sort of login page to add pages.

    Any ideas? thanks!

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I think you should do this using a database, but in case you don't want to, I did something like it once without one.

    I did the menu in javascript (based on DHTMLGoodies slidedown Menu) and the content as PHP includes, rather than use a database - the client was absolutely opposed to using a database, I am still not sure why, but it was fairly easy, if repetitive, to creat a simple php page for each item.

    I made a div called interiorPageContent (yeah, my div names can be long but they are descriptive) on the index page, and in it I wrote the PHP for the include, which came in according to what was chosen in the menu, and was styled by its own CSS that was listed in the <head> right after the main CSS.

    As far as I remember, the index page code looked like this:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="interiorStyle.css" type="text/css" media="screen" />
    <script src="menu.js" type="text/javascript"></script>
    </head>
    <body>
    <div id="mainContainer">
      <div id="topBar">
        <div class="innertext"><h1>Title of the site here</h1>
          <a href="#"><img src="images/header.jpg" /></a>
        </div><!-- close innertext -->
        <div id="nav">
         <ul>
          <li><a href="#">About Us</a></li>
           <li><a href="#">Contact Us</a></li>
         </ul>
        </div><!-- close topnav -->
      </div><!-- close topBar -->
     <div id="leftMenu">
    <!-- START OF MENU -->
      <?php include_once "menu.php"; ?>
    <!-- END OF MENU -->
            <script type="text/javascript">
            initSlideDownMenu();
            </script>
        </div><!-- close leftMenu -->
        <div id="interiorPageContent">
          <div class="clear"></div>
      <div id="interiorPages">
    
     <div id="topspace"><!-- this is for CSS styling to locate the contents on the page --></div>
    
    <?php
     if(isset($_GET['product']))
      {     include_once("interiorPageContent.php");      }
    
     else if(($product == "")) {
            include_once("filler.php");
        }
    ?>
      </div><!-- close interiorPages -->
    
     <div class="clear"> <p>&nbsp;</p></div>
    
      </div><!--close interiorPageContent -->
    
      <div class="clear"> <p>&nbsp;</p></div>
    
       <div id="footer">
           <h2 class="footerleft">Copyright &copy; Copyright here. </h2>
       </div><!-- close footer -->
    </div><!-- close mainContainer --><br>
    </body>
    </html>

    The interior Page code looked like this:
    Code:
    <?php
      $product="";
    
      if(isset($_GET['product']))
              {  $product=$_GET['product'];  }
    
        if(($product == "product1")) {
            include_once("products/product1.php");
        }
        else if(($product == "product1a")) {
            include_once("products/product1a.php");
        }
        else if(($product == "product1b")) {
            include_once("products/product1b.php");
        }
        else if(($product == "product1c")) {
            include_once("products/product1c.php");
        }
        else if(($product == "product2")) {
            include_once("products/product2.php");
        }
        else if(($product == "product2a")) {
            include_once("products/product2a.php");
        }
        else if(($product == "product2b")) {
            include_once("products/product2b.php");
        }
        else if(($product == "product3")) {
            include_once("products/product3.php");
        }
        else if(($product == "product4")) {
            include_once("products/product4.php");
        }
        else if(($product == "product5")) {
            include_once("products/product5.php");
        }
    ?>
    The menu.php was this:
    Code:
    <div id="dhtmlgoodies_slidedown_menu">
        <ul>
          <li><a href="index.php?product=product1">Producut 1</a>
            <ul>
              <li><a href="index.php?product==product1a">Producut 1- A</a></li>
              <li><a href="index.php?product==product1b">Producut 1 -B</a></li>
              <li><a href="index.php?product==product1c">Producut 1 - C</a></li>
            </ul></li>
          <li><a href="index.php?product=product2">Product 2</a>
            <ul>
              <li><a href="index.php?product=product2a">Product 2 - A</a></li>
              <li><a href="index.php?product=product2b">Product 2 - B</a></li>
            </ul></li>
          <li><a href="index.php?product=product3">Product 3</a></li>
          <li><a href="index.php?product=product4">Product 4</a></li>
        </ul>
    </div>
    I hope this helps a bit - let me know how it goes.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Banned
    Join Date
    May 2011
    Location
    Fairfax, CA
    Posts
    2,036
    Member #
    28003
    Liked
    126 times
    I guess that would be somewhat doable. But, how would the databse option work?
    Also, that menu is very different. i was looking for a drop down one like crucial.com.

    Thanks, though, for the help so far!

  5. #4
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Quote Originally Posted by shovenose, post: 218409
    I guess that would be somewhat doable. But, how would the databse option work?
    Also, that menu is very different. i was looking for a drop down one like crucial.com.

    Thanks, though, for the help so far!
    WOW! That's quite the dropdown menu!
    I used the slider on the side because that's the layout my client wanted - you could use the dropdown just as easily, I suppose.

    To do the database option, you'd put all your info into a database. Depending on your categories etc, you'd possibly have one table for each category and then fields for productID (unique), description, price, whatever. You'd use PHP to call the info from the db with SELECT statements - go here for more: http://www.w3schools.com/php/php_mysql_select.asp
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  6. #5
    Banned
    Join Date
    May 2011
    Location
    Fairfax, CA
    Posts
    2,036
    Member #
    28003
    Liked
    126 times
    Um...OK I'll review all this info when I get home. But how would I do the dropdown menu so that it finds the correct thing in the database? (did I phrase that correctly?)

  7. #6
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    You'd have to create the db first and write the PHP to select from it, then incorporate that into your menu. I think you'd be better off posting to the Database forum for this.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  8. #7
    Banned
    Join Date
    May 2011
    Location
    Fairfax, CA
    Posts
    2,036
    Member #
    28003
    Liked
    126 times
    Could you please move this topic then? 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 10:17 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com