hwg-languages archives | Apr 2000 | new search | results | previous | next |
Re: Another PHP problemby Reywob(at)aol.com |
|
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