SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Buliding a dynamic Website. Steps.

    Hello everyone,

    I have a "steps" question Let me explain what happened: My friend asked me to design a dynamic website with php/mysql, so I went out and bought Kevin Yank's Book (Build Your own Database Driven Website Using PHP & MySQL). Great book, no complaints, but I'm looking for the answer to what could be a simple question -- what are the steps in building a dynamic website??? (I have php/mysql installed on a live server and local env., so we can skip that). I've read somewhere that I need to create a bunch of library files, library directory and convert my static html code to php. Well, Can somebody help me with proper steps on how you actually build your website after designing a static template for it?
    Sincerely,

    Basil
    basil@basilcraft.com

  2. #2
    SitePoint Addict The Mog's Avatar
    Join Date
    Dec 2002
    Location
    Manchester UK
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    personally this is my way of developing....


    create the templates.

    create the database to hold the data
    create the code to input the data
    create the code to output the data

    fin

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you are new to php, you shouldn't be worried about things such as librarys or classes, as they will only confuse you.

    you should try following this plan:

    Code:
    Create template
     - devide template into 3 sections:
        + Header (everything above the main body/content)
        + Footer (everything below the main body/content)
        + Everything else (the main body/content)
     - create header.php and footer.php
        + In header, put your db connection code in php tags, then close the tags and put in your header html
        + In footer, put in your footer html, followed by your db close info in php tags
    create code for front end - the stuff that displays the stuff

    then code admin section


    this is by no means the best way to complete a php site, but it is probably the simplest...

  4. #4
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you guys for explanation

    Now it's time to get my "feet wet". Wish me luck
    One more time -- Thank you very much for your support.
    Sincerely,

    Basil
    basil@basilcraft.com

  5. #5
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A (semi) minor point: I like to do the meat of my db work before I start outputting the HTML header. This helps out with
    A)Generating dynamic title tags etc.
    B)Handling failed DB connections/queries gracefully (as in no half loaded pages)

    I usually handle it like this:
    Code:
    Include all-purpose business logic header
    Page specific intialization and DB code
    Include HTML header
    Code to generate the content to  the page
    Include HTML footer

  6. #6
    SitePoint Addict The Mog's Avatar
    Join Date
    Dec 2002
    Location
    Manchester UK
    Posts
    310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also believe that any good site has to be built on a great database.

    Thats the foundation, if that crumbles then it was all in vain

  7. #7
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - create header.php and footer.php
    + In header, put your db connection code in php tags, then close the tags and put in your header html
    + In footer, put in your footer html, followed by your db close info in php tags
    -----------------
    I have a left side navigation bar (nested table) which is in the main body of the page, where do I place it? Is there a way to separate it from a main content without ruining the structure?
    Sincerely,

    Basil
    basil@basilcraft.com

  8. #8
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Left side bars are header, right sidebars are footer. HTML is parsed left to right, top to bottom.

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone have any tutorials other than Kevin's book?
    Thomas C. K.
    World Web Works
    www.wowewo.net *** 773-685-7634
    Your Internet Solutions Provider

  10. #10

  11. #11
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's a good list, Basil, you should also add it to this list:
    http://www.sitepointforums.com/showt...threadid=93637

    A good list as it is but add decriptions and the sirens will sing your praises. Well, maybe not, but ....
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  12. #12
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by anode
    Left side bars are header, right sidebars are footer. HTML is parsed left to right, top to bottom.
    Ok, Ladies and Gentlemen,

    Correct me if I'm wrong, here's a plan I came up with on how to properly split up a static nested table page so it'll work on my site:
    -----------------
    1. Variables (connection to DB, username, password, etc)
    2. Metatags
    3. Header table (that's where I have my logo)
    4. User status, page status table (i.e. you are logged on as basilcraft, you are at: welcome page)
    5. Left menu table
    6. Main data table opens
    7. Actuall data being pulled from the DB
    8. Closing main data table
    9. Right side table with small banners, ads
    10. Footer
    ----------------
    Ok, this is just a projection, I'm not sure whether I'm wright or wrong. All commets/suggestions are more than welcomed.
    here's a static page location, maybe this will help:http://www.mogdalov.com/redone_index01.htm

    Thank you in advance,
    Sincerely,

    Basil
    basil@basilcraft.com

  13. #13
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your basic page has 4 sections:

    PHP Code:
    ----------------------
    |                        |
    ----------------------
    |     |                  |
    |     |                  |
    .     .                  .
    .     .                  .
    ----------------------
    |                        |
    ---------------------- 
    What I did was to have for example, an index.php file - the home page right ?

    In this file, at the top I INCLUDEd the header part, inside a TABLE cell, then began a new TABLE row, and INCLUDEd the navigation on the left side, and then the PHP scripts, database connections etc etc within the content part - which was part of the index.php file it's self.

    Each page therefore had it's own unique piece of script and functions etc.

    Then I closed off this cell, began a new TABLE row, and INCLUDEd the footer at the bottom.

    This is another alternative for you - it's the most simplest to understand and create though not the best to maintain over any great period of time.

    Your best bet is to learn Templating - initially it'll take longer to learn and use but for the long haul it'll be the quickest and easiest to maintain and change....

    Just my thoughts though 8)

  14. #14
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You will proberly find this of interest since it's revelant to your post over at www.onlamp.com:

    http://www.onlamp.com/pub/a/php/2003..._heredocs.html

    This would provide one solution to your needs - fully explained as well

    What more can you ask for ?

  15. #15
    SitePoint Member
    Join Date
    Dec 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you very much mr. Livingston

    Your input was more than helpful to me
    Sincerely,

    Basil
    basil@basilcraft.com

  16. #16
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excuse me ?

    It's Dr Livingston.... as in Dr Livingston I presume ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •