Forum Moderators: coopster
I have a link to a php script that pulls all products from database say id's 1-1000 . so i try find widget and it comes up with 1-100 of products .
1. do each of those results create a html page or is it only one page?
2.how do some pages have internal links of 1-150000?
is this becuase they have created pages using php? if so does anyone know of a tutorial that can help with this?
Regards
Malcolm
1)May be either.
However as you are using a databse to get the results I would guess that the pages are coming from a template, and the results of the database are then put into that template. i.e.
database returns blue widgets, 1000 in stock, cost £25.95 each.
Template has spaces for product name (blue widgets), number in stock (1000) and price (£25.95 each). So when you ask for information on grey widgets you get a different page, but this page if actually the same php script, just with different text.
2) well hopefully the answer to 1 has helped.
There may be a piece of returned information from the database that says blue widgets come in 200 different varieties, so the page then says title (blue widgets), varieties (super blue, dark blue, light blue, etc) and there are links to all of these pages.
PHP is often used alongside mod_rewrite so that you can use a url like blue_widgets.php and this is passed to a script (for example) called products.php, that uses the query string to look up the items in a database and then build a page around the response from the database.
So mod_rewrite turns /products/blue_widgets.php into
products.php?prod=blue_widgets
The products.php can use that to build its page for that product.
Google for 'php dynamic pages', and there are a load of tutorials that will help you understand.