Can anyone help me?

Hi there…

I am new here and also new in PHP PROGRAMMING…

I have some question which may be very basic,but i want to learn…

suppose i am going to make a website. and there is 5 menu/button/navigation items. like “DOG” “CAT” “SNAKE” “LION” “TIGER”. for each item i have to create page dog.php … cat.php… lion.php…snake.php. that means if there 100 button/menu i have to create 100 pages like this…

but i saw in modern database driven site they create only a BASE clicking the menu only the content/ header/meta tags changes.

My question is how to do this… what it is called is there any good tutorial for this?

Advance thanks

Hey there,

There’s probably a few ways to do this, and a lot of it comes down to personal choice and skill level.

If it were me, i’d probably create a MySQL database with all the content, then build the page on the fly. You’d only have to build one page, and just feed it the content.

There are some great books by SitePoint for learning about MySQL and PHP. Personally, I’d go for “Build Your Own Database Driven Website with PHP & MySQL” by Kevin Yank.

Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition - SitePoint Books

At a really basic level, what you’re looking for is a switch navigation -
Navigation Using Switch | PHP

Now that means you could use links such as -

So for each section you could run a different query, you could include a different page or do what ever you want but it always uses the same base page.

wow!! thanks thanks for helping me… i am looking on the links that you guys provide me…