如何创建一个多页网站 [英] how to create a multipage website
问题描述
如何开发多页网站? 我应该以创建主页的相同方式开发所有其他链接的页面吗? 我打算为商店开发一个PHP网站,并且希望将每个产品链接到各自的页面.但是由于有很多产品,因此要为每个产品创建单独的页面有点繁琐.
how can I develop a multipage website? should I develop all other linked pages in same way I created the homepage? I am intending to develop a PHP website for a store and I wanna link each products to their individual pages. but since there are lots of products its kinda tedious to create individual pages each product.
SO我可以为一个产品创建一个动态更改的页面,并将其用于所有产品链接,而不是为每个产品创建许多不同的页面?我可以创建一个页面,其基本布局始终保持不变,但内容很少根据所选产品进行更改.
SO Instead of creating many different pages for each product can I create one dynamically changing page and use it for all the product links?I mean can I create a single page whose basic layout will always remain the same but only few content will change in accordance to the selected product.
推荐答案
您可以实现一个页面,将其称为product.php
.然后,您可以使用GET
方法动态调用页面.看起来像product.php?id=1
,其中id=1
是产品在MySQL表中的主键.而且,您只需更改url中的id就可以获取各种产品.
You can implement a single page, lets call it product.php
. Then you can use theGET
method to dynamically call the page. It would look like this product.php?id=1
where id=1
is the primary key of the product in a MySQL table. And you could fetch various products just changing the id in url.
这篇关于如何创建一个多页网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!