You are here: Re: Getting variables from another file « PHP Programming Language « IT news, forums, messages
Re: Getting variables from another file

Posted by Rik on 10/23/70 11:55

Ψrjan Langbakk wrote:
> 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?

Why not create an CSV, and use fgetcsv() and fputcsv() to get/store the
data? That way it's still pretty easy to update/add/delete stuff, and you
could even run a database somewhere else that would periodically upload a
changed csv easily. Maybe even parse_ini_file() could help you here, but I
doubt it will handle very nicely once the shop grows.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация