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 3 of 3
  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    1
    Member #
    27858
    Hi
    I've made a few websites using html and ccs, but now i want to move on.

    What i want to know is, is it possible to have one page, which can be reloaded but with a different variable to call the individual page contents from a database? so one could have, say 20 essays, but not have to create an individual html page for each one. I know a little php and have access to hosting with sql databases.

    Thanks
    Iz

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    I've done it, so I'm sur you can do it. I used a combination of javascript for the menu and a bunch of PHP includes inside divs that were styled and positioned in the CSS.
    Like this:
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
        <title>TITLE HERE</title>
    <link rel="stylesheet" href="style.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>Whatever the site is about goes here</h1>
     <a href="#"><img src="images/header3.jpg" /></a>
     </div><!-- close innertext -->
     <div id="topnav">
        <ul>
          <li><a href="aboutus.php">About Us</a></li>
          <li><a href="contactus.php">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="mainContent">
      <div class="clear"></div>
        <div id="interiorPages">
          <div id="topspace"></div><!-- close topspace -->

    <?php

     
    if(isset($_GET['product']))
      {     include_once(
    "interior.php");      }

     else if((
    $product == "")) {
            include_once(
    "index1.php");
        }
    ?>

        </div><!-- close interiorPages -->
      <div class="clear"> <p>&nbsp;</p></div>
    </div><!--close mainContent -->
      <div class="clear"> <p>&nbsp;</p></div>
    <div id="footer">
    <h2 class="footerleft">Copyright &copy; Copyright notice here. </h2>
    </div><!-- close footer -->
    </div><!-- close mainContainer --><br>

    </body>
    </html>
    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
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Depending on your hosting provider, they may have some tutorials specifically for your patricular environment. Many have FAQ's that are particular to how they have their DB servers setup and how to connect to them...

    SQL is pretty simple, but if you cannot setup a DB or connect to it, it's kind of difficult to explain...

    Starting out in developing PHP, and pulling contents from a DB can be tricky without knowing any of the particulars.

    In ASP you can pass variable to the SQL script that will call the particular content http://mypage.php?q=1 will call one set of conent where http://mypage.php?q=2 will call completely different content...

    I'm sure it's pretty similar if not just like that.


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
  •  

Search tags for this page

call from database html

,

calling database to html

,

how to call database from html page

,

html calls to a database

Click on a term to search for related topics.
All times are GMT -6. The time now is 10:48 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com