donglu4633 2014-01-17 04:48
浏览 46
已采纳

零售网站如何使用单个产品信息填充页面? [关闭]

This is a silly question and I will get some backlash for it, but I don't know how to ask the question in search bars, so I can't find the answer.

I'm trying to figure out how sites like ebay, pccasegear etc populate their product page with information about each specific item.

I know they obviously wouldn't have a html page for each product, which is ridiculous. So I assume they would have to have a single product page which was populated from a database by php or something like this.

My question is, how is this done? and how could I go about coding this without using php or using a database?

I ask this because I am required to code a website for my course, and it asks to have 12+ dummy products, and I do not want to create a html page for each product.

  • 写回答

1条回答 默认 最新

  • doudou0111 2014-01-17 04:50
    关注

    At a very high level: the data about each product is stored in a structured, computer-friendly format, not as HTML. Typically it will be stored in a database of some sort: SQL, NoSQL, whatever.

    The product data is programmatically turned into HTML on-the-fly using some sort of HTML templating. It doesn't take much imagination to see how this part works. There's some "skeleton" structure (the template) into which the specific product information is substituted, using some sort of special placeholders.

    Consider this totally-made-up template as an illustrative example:

    <h1> {{ product_name }}  </h1>
    <p> {{ product_description }} </p>
    

    – can you see where this is going?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址