Re: Another PHP problem

by "Rossi Designs" <webmaster(at)rossidesigns.net>

 Date:  Sat, 22 Apr 2000 19:08:06 -0400
 To:  <Reywob(at)aol.com>,
<nik(at)cheddarcheese.de>,
<jmcates(at)worldnet.att.net>,
<hwg-languages(at)hwg.org>
 References:  aol
  todo: View Thread, Original
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