PDA

View Full Version : problem with condition


Jakeman
06-26-2002, 06:20 AM
condition in the phpinclude template:

if ($forumid == 3 || 26) {
$picnumber = $forumid;
} else {
$picnumber = '';
}


goal:
the goal here is to have $picnumber parse into the forumid of the current forum when loading forumdisplay.php . example, you click on the forum with forumid 3 and $picnumber will parse into 3. then you click on the forum with forumid 6 and it parses into nothing.

problem:
the condition is evaluating to true for all forums. i load forumdisplay.php and, regardless of what forumid is in the url, the condition evaluates to true and $picnumber always parses into the forumid of the current forum. i can't figure out why this is always parsing to true. any help is appreciated.

Admin
06-26-2002, 06:26 AM
if ($forumid == 3 or $forumid == 26) {

Jakeman
06-26-2002, 06:30 AM
that worked *cream pie* ;)

Jakeman
06-26-2002, 06:57 AM
that is to say, it worked on my test forums but not for the person i'm doing this for. his forums give this error at the top of every page now:

Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site3/fst/var/www/html/global.php(281) : eval()'d code on line 1

the error refers to the first line of the phpinclude template (where the if statement is). and so my questions are...

questions:
1. what does this error mean? i'm not sure what a t_variable is.
2. how do i fix it?

Jakeman
06-26-2002, 08:03 AM
thx for the help tonight firefly :)

Dark_Wizard
06-26-2002, 10:48 AM
<a href="http://www.php.net/manual/en/tokens.php" target="_blank">http://www.php.net/manual/en/tokens.php</a>