Re: web application development question
| From: | Richard Baskett | Date: | Fri, 26 Apr 2002 20:11:47 +0000 |
| Subject: | Re: web application development question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94799@lists.php.net to get a copy of this message | ||
By the way.. You can include a little script in your .htaccess file or your
httpd.conf file so that it will not show .inc files just like it does for
.ht files. That's a great idea for the $_CONF array.. That will help me
keep some of my variables straight and where they come from :)
Cheers!
Rick
"What's in a name? That which we call a rose by any other name would smell
as sweet." - Shakespeare
> From: "John Holmes" <holmes072000@charter.net>
> Organization: U.S. Army
> Reply-To: <holmes072000@charter.net>
> Date: Fri, 26 Apr 2002 16:11:26 -0700
> To: "'Richard Baskett'" <rick@baskettcase.com>, "'Erik
> Price'"
> <pricee@hhbrown.com>, "'PHP General'"
> <php-general@lists.php.net>
> Subject: RE: [PHP] web application development question
>
> Agreed, this is how I would recommend you do it. I would be careful
> naming your include files with an .inc extension, though, since .inc
> isn't parsed by PHP and will be shown as plain text when pulled up in a
> web browser. I normally name them something like config.inc.php or
> database.inc.php, etc.
>
> I've gotten into the habit, from working with GeekLog, to put everything
> into a $_CONF array.
>
> $_CONF["database"] = "MySQL";
> $_CONF["multiplier"] = 1.5;
>
> etc...
>
> ---John Holmes...
>
>> -----Original Message-----
>> From: Richard Baskett [mailto:rick@baskettcase.com]
>> Sent: Friday, April 26, 2002 1:01 PM
>> To: Erik Price; PHP General
>> Subject: Re: [PHP] web application development question
>>
>> I usually have an info.inc file that has all these variables that I
> might
>> need to change. Then include it in the files that use those variables
> and
>> if I ever need to change one of them I just change it in the include
> file
>> and it updates everything that way..
>>
>> Rick
>>
>> Beauty of whatever kind, in its supreme development, invariably
> excites
>> the
>> sensitive soul to tears. - Edgar Allan Poe
>>
>>> From: Erik Price <pricee@hhbrown.com>
>>> Date: Fri, 26 Apr 2002 15:50:08 -0400
>>> To: php-general@lists.php.net
>>> Subject: [PHP] web application development question
>>>
>>> For those of you who write web applications (in any language), what
> do
>>> you recommend as the best way to store arbitrary atomic data for the
> web
>>> application? in other words, data that doesn't really need to be
> stored
>>> in a relational database, as it does not really relate to anything?
>>>
>>> In the app I am working on (PHP/MySQL), there are several instances
> of
>>> this. One of them is:
>>> a multiplier of 1.5 is applied to any "materials cost" of posters
>>> ordered through my app. That is, although the "materials cost" to
> my
>>> employer is, say $0.076 per square inch, 0.114 is the amount that we
>>> charge per square inch (0.076 * 1.5). However, this multiplier
> could
>>> change at some point in the future, so I am hesitant to leave the
> number
>>> hard-coded into my page. I would rather have it stored in the
> database,
>>> where my employer can easily update or change it to another
> multiplier.
>>> But it seems awkward to create a table that simply maintains the
>>> multiplier:
>>>
>>> mysql> SELECT * FROM material_multiplier;
>>> +------------+
>>> | multiplier |
>>> +------------+
>>> | 1.50 |
>>> +------------+
>>> 1 row in set (0.00 sec)
>>>
>>> I suppose I could store a table with two columns, one being VARNAME
> the
>>> other being VALUE, and pull this kind of standalone data out of it,
> but
>>> was curious what other people do when they need to store something
> like
>>> this.
>>>
>>>
>>> Erik
>>>
>>>
>>>
>>>
>>>
>>> ----
>>>
>>> Erik Price
>>> Web Developer Temp
>>> Media Lab, H.H. Brown
>>> pricee@hhbrown.com
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>