Re: Another PHP problem

by "Cyanide _7" <leo7278(at)hotmail.com>

 Date:  Sat, 22 Apr 2000 17:57:47 CDT
 To:  Reywob(at)aol.com
 Cc:  hwg-languages(at)hwg.org
  todo: View Thread, Original
i guess im a little confused as to how "site" aquires its value. also, i 
recommend setting up the defaults, and merely modifying them in the 
if-then-elseif-then statements. like so:

$sitecss = "http://www.narrowgauge.f2s.com/style.css";
$sitename = "Narrow Gauge on the web";
$siteurl = "http://www.narrowgauge.f2s.com";

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";
}

somehow i think site isn't being defined if no data is sent via the search 
string. - Cyanide_7

>
>Thanks for spotting that.  Unfortunately that hasn't cured any error
>messages, as it isn't even getting that far.  See the errors at:
>
>http://www.narrowgauge.f2s.com/phorum/
>http://www.narrowgauge.f2s.com/phorum/?site=pwp
>
>The ful code I've got for my header.php is:
>
>
><HEAD>
><?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";
>}
>?>
>
><meta name="Phorum Version" content="<?PHP echo $phorumver; ?>">
><meta name="Phorum DB" content="<?PHP echo $DB->type; ?>">
><meta name="PHP Version" content="<?PHP echo phpversion(); ?>">
><TITLE>phorum - <?PHP if(isset($ForumName)) echo $ForumName; ?><?PHP echo
>$title; ?></TITLE>
><link rel="stylesheet" href="<?PHP echo $sitecss; ?>" type="text/css">
><STYLE>
>   INPUT {font-family: Arial, Helvetica;font-size: 10pt;}
>   TEXTAREA {font-family: Arial, Helvetica;font-size: 10pt;width: 500px;}
>   .forum_title {font-family: Arial, Helvetica;font-size: large;}
>   .forum {font-family: Arial, Helvetica;font-size: medium;}
>   .nav {font-family : Verdana, Geneva, Arial, Helvetica, 
>sans-serif;font-size
>: 8pt;}
></STYLE>
></HEAD>
>
><center>
><div class=forum_title><?PHP echo $ForumName; ?></div>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA