Re: Perform maths based on a number in a text file [message #183748 is a reply to message #183747] |
Mon, 18 November 2013 10:57 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma:
|
Senior Member |
|
|
drkirkby(at)gmail(dot)com wrote:
> […]
> So if A was 10
>
> 1) Page 1 should show 10
> 2) Page 2 should show 30
> 3) Page 3 should show -20.
>
> If the value of A changes, I'd like to update the web site in one place,
> and not go around to every page updating them individually, as that will
> be error prone.
>
> Is there a way to put the value of A in a text file, and use the value in
> different parts of the site? If so how?
<http://php.net/file_put_contents>
<http://php.net/file_get_contents>
However, it would be easier to include a constant definition.
> Since there will actually be 15 or so parameters, A, B, C ..., is there a
> way I can put all 15 parameters in a file (perhaps one per line, or with
> white space between them), rather than have 15 different files?
Yes.
> Any thoughts?
Do your own homework.
--
When all you know is jQuery, every problem looks $(olvable).
|
|
|