从另一个文件中获取变量 [英] Getting variables from another file
问题描述
我想制作一个文件,其中包含一个小的
网店的完整价格表(是的,我知道后台的数据库会很多
更简单,但不幸的是,今天不是一个选项。
我在想像创建一个包含产品名称的文件
和价格,以及那么只需从其他页面获得价格
需要它。 (通常是一个类别中所有产品的概述页面,
和特定产品页面。)
我在想它是可能的创造类似的东西:
#Product 1
$ produkt1 = 2000
#produkt 2
$ produkt2 = 1400
等等
这是创建这个的好方法吗?
什么是将信息传递到需要
解析文件的最佳方法? $得到什么?或完全不同的东西?
-
mvh
?rjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net
I wanna make a file that holds the complete pricelist for a small
webshop (yes, I know that a database in the background would be a lot
simpler, but that is not an option today, unfortunately).
I''m thinking something like creating a file that holds the productname
and the price, and then just get the price from the other pages that
needs it. (Typically an overview page of all the products in a category,
and the spesific product pages).
I''m thinking it would be possible to create something like:
#Product 1
$produkt1 = 2000
#produkt 2
$produkt2 = 1400
and so on
Is this a good way to create this?
And what is the best way to get the informatin into the file that needs
to parse it? $GET? or something else entirely?
--
mvh
?rjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net
推荐答案
produkt1 = 2000
#produkt 2
produkt1 = 2000
#produkt 2
produkt2 = 1400
等等
这是一个很好的创建方式吗?
什么是将信息传入需要的文件的最佳方式
要解析吗?
produkt2 = 1400
and so on
Is this a good way to create this?
And what is the best way to get the informatin into the file that needs
to parse it?
GET?或完全不同的东西?
-
mvh
?rjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net
GET? or something else entirely?
--
mvh
?rjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net
这篇关于从另一个文件中获取变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!