Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11818

Re: Perform maths based on a number in a text file

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!takemy.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <20674060.4IAKZ2NE0I@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <php@PointedEars.de>
Organization PointedEars Software (PES)
Date Mon, 18 Nov 2013 11:57:04 +0100
User-Agent KNode/4.10.5
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: Perform maths based on a number in a text file
Newsgroups comp.lang.php
References <83ddeb0e-5749-4602-bda0-e9d6770feb44@googlegroups.com>
MIME-Version 1.0
Lines 33
NNTP-Posting-Date 18 Nov 2013 11:57:08 CET
NNTP-Posting-Host bf595652.newsspool2.arcor-online.net
X-Trace DXC=@J:=LihkhV;TQL:hoD@>T?A9EHlD;3Yc24Fo<]lROoR18kF<OcfhCO;gUnZ0:D:6`:DZm8W4\YJN<YUVHKH;GI^7;S2JoZ]LBU>`3nWO_h\BB8
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.php:11818

Show key headers only | View raw


drkirkby@gmail.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).

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-18 01:23 -0800
  Re: Perform maths based on a number in a text file Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-18 11:57 +0100
  Re: Perform maths based on a number in a text file The Natural Philosopher <tnp@invalid.invalid> - 2013-11-18 13:19 +0000
    Re: Perform maths based on a number in a text file Tim Streater <timstreater@greenbee.net> - 2013-11-18 15:08 +0000
      Re: Perform maths based on a number in a text file The Natural Philosopher <tnp@invalid.invalid> - 2013-11-18 16:22 +0000
        Re: Perform maths based on a number in a text file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-18 16:50 +0000
        Re: Perform maths based on a number in a text file Tim Streater <timstreater@greenbee.net> - 2013-11-18 16:53 +0000
    Re: Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-20 03:50 -0800
      Re: Perform maths based on a number in a text file David Robley <me@home.invalid> - 2013-11-20 22:32 +1030
      Re: Perform maths based on a number in a text file The Natural Philosopher <tnp@invalid.invalid> - 2013-11-20 13:03 +0000
      Re: Perform maths based on a number in a text file Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-20 11:20 -0500
  Re: Perform maths based on a number in a text file Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-18 14:46 +0000
    Re: Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-20 03:53 -0800
  Re: Perform maths based on a number in a text file Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-18 11:38 -0500
    Re: Perform maths based on a number in a text file drkirkby@gmail.com - 2013-11-20 03:58 -0800
  Re: Perform maths based on a number in a text file Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-21 03:10 +0000

csiph-web