如何解决创建多个静态页面的问题
我正在一个网站上工作,我需要从单个表中检索数据并将某些数据显示为页面。
例如:
name: xyz
state: Texas
city: Dallas
category: test
等等...我在表中没有这样的记录。我需要的是在一页中检索所有州,在一页中检索所有城市,在一页中检索所有类别,在它们之间建立关系。当我在州页面上时,如果我单击德克萨斯州,所有相关城市都必须显示在另一个页面中。当我在类别页面上时,如果单击某个类别,我需要显示与该类别相关的所有状态。
所有这些都可以使用查询来完成,但是我想要的是将它们显示为静态页面。那么,您能给我建议一个解决方案吗?
谢谢。
i am working on a site where i need to retrive data from a single table and display some of the data as pages.
for example:
name: xyz
state: Texas
city: Dallas
category: test
etc... I have no.of records like this in a table. what i need is to retrieve all the states in one page and all the cities as one page and all the categories as one page making a relation between them. When i'm on states page if i click on texas all the related cities has to be displayed in another page. When i'm on category page if i click on a category i need to display all the states that relates to that category.
All this can be done using queries but, what i want is to display them as static pages. So, can you please suggest me a solution for this?
Thank You.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么它们必须是静态的?
如果是性能问题,您可以动态生成它们并缓存结果。如果是服务器限制(成本、安全性等),则在本地生成它们,并将其复制到服务器。如果这是古老的“静态页面更适合 SEO”的说法,那么这不再适用,您只需使用 Apache 将 .html 添加到 URL 即可。
Why do they have to be static?
If it's a performance thing, you can generate them dynamically and cache the results. If it's a server limitation (cost, security, etc), then generate them locally, and copy that over to the server. If it's the age-old 'static pages are better for SEO' thing then that doesn't apply any more, and you can just add .html to the URL with Apache.