Results 1 to 2 of 2

Thread: hard code content or fetch from database for a lot of restaurants !!!!

  1. #1
    Join Date
    Feb 2013

    Post hard code content or fetch from database for a lot of restaurants !!!!

    I am going to build a website which is about to have a lot of restaurant, say 200 restaurants. i am going show the menu for every restaurant. and further items in menu.

    1st Question: Should I hard code the menus and item details or should i use the database??

    2nd Question: I want my website pattern something like that, if i click on restaurant "Pisa Pizza"
    my URL should be like this www.myrestaurant.com/pisa_pizza/
    and content of page will be all the details of "Pisa Pizza".
    Further if i click on the menu button
    my URL should be like this www.myrestaurant.com/pisa_pizza/menu
    and content of page will be all the details of "Menu".

    I am just confused, this way i may have to make a lot of sub directories, what should i do here. Because there are too much restaurants i can't make a separate for all of them.

    And i am building my website in CODE CHARGE using PHP.

    I will be thankful if any one give me idea and right direction .


  2. #2
    Join Date
    Aug 2004
    If you set things up right, you can make use of URL re-writing in the web server to keep your "friendly" URLs while storing all the user data in the DB. Pretty much any PHP framework you might use would have this ability "out of the box". Then you don't actually have separate directories and files for each restaurant, but one single entry point that receives the URI parts as get/post variables*, which you then use to select the desired info from the DB and output via the applicable template (view).
    * or as arguments to controller methods
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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