Simple PHP and MySQL Website

Discussion in 'HTML & Website Design' started by thelethargarian, Feb 11, 2010.

  1. #1
    I have been googling/searching and learning about PHP and MySQL for the past month, but can't really figure out this one simple (I would think anyway) site I want to setup. I want a site with a common template, probably in the form of one PHP file with a CSS stylesheet, that has dynamic content from a MySQL database that changes depending on the url. Something like how a Blog (like Wordpress), or Bulletin Board (like phpBB) work, but simpler.

    For example, if I had template.php that looked like this:
    
    <html>
    <head>
    <title>
    </title>
    </head>
    <body>
    [COLOR="Red"]Variable Content PHP Code[/COLOR]
    </body>
    </html>
    
    Code (markup):
    What type of code would I use to access different database rows depending on the url they go to (like example.com/index, example.com/about, example.com/links, etc).

    Thank You So Much!
     
    thelethargarian, Feb 11, 2010 IP
  2. martin.lawrence

    martin.lawrence Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello there..
    You first have to create one database ehich contains several tables like info, about etc. as per your need..
    then you have to create code to connect database..

    $conn=mysql_connect("name of database");

    After then you can pass query in body part to make any database operation like insert, update or delete.

    Thank you.

    ------------------------------

    Martin Lawrence

    ClickSSL.com | geotrust reseller, renew ssl, 2048 bit ssl
     
    martin.lawrence, Feb 12, 2010 IP
  3. LeetPCUser

    LeetPCUser Peon

    Messages:
    711
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It is based on whether you have a server running on Widnows or Apache. You want to use PHP to gather the URL ending after the first /, you can do this using explode, and then parse the information based on that result.
     
    LeetPCUser, Feb 12, 2010 IP
  4. thelethargarian

    thelethargarian Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    On my server, I'm running a LAMP server setup (Linux, Apache, MySQL, PHP). I don't think that is really what I want though, as you don't have to do any of that with a standard PHP based BB or Blog, it just makes the url :confused:. How does that work?
     
    thelethargarian, Feb 12, 2010 IP
  5. franzbiely

    franzbiely Peon

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    franzbiely, Feb 12, 2010 IP
  6. sp2h

    sp2h Peon

    Messages:
    189
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    its not a easy job what do you need in your php website??? its depend on coding, php is not a small language
     
    sp2h, Feb 12, 2010 IP
  7. nadiralishah_webexpert

    nadiralishah_webexpert Guest

    Messages:
    229
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    you actually need to make a simple CMS. This is possible using your own php programming and ur logics how make it possible.. But this is possible and not a big job... its easy.
     
    nadiralishah_webexpert, Feb 12, 2010 IP