Displaying data based on URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • artemishawk
    New Member
    • Nov 2009
    • 1

    #1

    Displaying data based on URL

    I am kind of new to PHP and I would like to set up a page that displays information based on the url visited. For example, a user visits www.website.com/test. I need the page to determine if there is a "test" in my SQL database and display a default page filled in with the data associated with that entry in the database if there is. If not, a message stating the data was not available would be displayed.

    I really appreciate any help that can be offered. Thanks!
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Look into some PHP tutorials as basic PHP knowledge you would be able to at the least start to write this script.

    Basically you would read the value using the $_GET[] global variable.
    Validate it (make sure someone is not trying to hack you)
    Give it to the database
    Based on the results, display the appropriate content.

    Google for some PHP and MySQL tutorials, start coding and let us know where you get stuck,




    Dan

    Comment

    Working...