hwg-languages archives | Apr 2000 | new search | results | previous | next |
Re: Another PHP problemby "Rossi Designs" <webmaster(at)rossidesigns.net> |
|
if (!isset($site) { ...do stuff... } elseif (..rest of your code) { Rossi Designs PO Box 1084 Holly Hill, FL 32125-1084 Phone : (904) 226-8979 URL : http://rossidesigns.net ----- Original Message ----- From: <Reywob(at)aol.com> To: <nik(at)cheddarcheese.de>; <jmcates(at)worldnet.att.net>; <hwg-languages(at)hwg.org> Sent: Saturday, April 22, 2000 10:08 AM Subject: Re: Another PHP problem | Thanks for that - amazing what you can miss! That cured one problem | | The problem now: | If $site isn't set then it returns an error message (reproduced below). e.g. | http://www.narrowgauge.f2s.com/phorum?site=pwp works OK, but | http://www.narrowgauge.f2s.com/phorum returns this message: | =========== | Warning: Uninitialized variable or array index or property (site) in | ./include/header.php on line 4 | | Warning: Uninitialized variable or array index or property (site) in | ./include/header.php on line 8 | | Warning: Using uninitialized variable $site in | /web/sites/31/reywob/www.narrowgauge.f2s.com/phorum/index.php on line 92 | =============== | | How can I get round that? The code I'm using is: | | <?PHP | if ($site == "pwp") { | $sitecss = "http://members.aol.com/reywob/newstyle.css"; | $sitename = "Peters Web Page"; | $siteurl = "http://members.aol.com/reywob"; | } elseif ($site == "rm") { | $sitecss = "http://www.railwaymodelling.co.uk/style.css"; | $sitename = "Railway Modelling"; | $siteurl = "http://www.railwaymodelling.co.uk"; | } else { | $sitecss = "http://www.narrowgauge.f2s.com/style.css"; | $sitename = "Narrow Gauge on the web"; | $siteurl = "http://www.narrowgauge.f2s.com"; | } | ?> | | And the } else { statement is working fine. | | TIA, | Peter. |
HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA