Generating Pages with one file

Discussion in 'PHP' started by kampbell411, Jan 11, 2008.

  1. #1
    I was wondering if someone could help me find something on how to generate pages from content in the database. I want to just have listings that when clicked on go to one page that pulls the content for that listing on that page, instead of having a million static pages. Kind of like a template page that just inserts the information from the listing that was clicked on. How does the page that pulls this info know what listing it came from? Thanks
     
    kampbell411, Jan 11, 2008 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    Just post back to the same file with the query string, process it, pull from the db and its the same page.
    Short example would be index.php, the base page with a form...
    Say its about cars. You want to see toyotas so its index.php?query=toyotas.(this comes from a form or drop down box or links)
    You have to put the code in to pull all the toyotas from the DB.

    Here's an article about it
    http://www.codewalkers.com/c/a/Database-Articles/Create-dynamic-sites-with-PHP-MySQL/10/

    Answer to the last question is : the page is defined by the selection made, if nothing is selected it should show the main listing page.
     
    shallowink, Jan 11, 2008 IP
  3. kampbell411

    kampbell411 Peon

    Messages:
    82
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Excellent! Thanks for the help. I make things more confusing then they are. Thanks again.
     
    kampbell411, Jan 11, 2008 IP