This is what I get:
Parse error: parse error, unexpected T_ELSEIF in C:\Inetpub\webpub\forecast\text\text_products.php on line 110
Here is my code:
<?php
If ($id == "01")
readfile("1/01.txt");
elseif ($id == "02")
readfile("2/01.txt");
elseif ($id == "06")
echo "<span style='color: 00FF00; font-size:15Pt; font-weight: bold'>Text Forecast</span>";
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>Adjala-Tosorontio</span>";
echo "<BR>";
readfile("../../f/textf/01.txt");
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>City of Barrie</span>";
echo "<BR>";
readfile("../../f/textf/02.txt");
elseif ($id == "07")
readfile("7/01.txt");
elseif ($id == "08")
readfile("8/01.txt");
elseif ($id == "09")
readfile("9/01.txt");
elseif ($id == "10")
readfile("10/01.txt");
elseif ($id == "11")
readfile("11/01.txt");
elseif ($id == "12")
readfile("12/01.txt");
?>
Line 110 is:
elseif ($id == "06")you should really use a switch statement instead of all those elseif's
but this should fix it
<?php
if ($id == "01"){
readfile("1/01.txt");
}
elseif ($id == "02"){
readfile("2/01.txt");
}
elseif ($id == "06"){
echo "<span style='color: 00FF00; font-size:15Pt; font-weight: bold'>Text Forecast</span>";
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>Adjala-Tosorontio</span>";
echo "<BR>";
readfile("../../f/textf/01.txt");
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>City of Barrie</span>";
echo "<BR>";
readfile("../../f/textf/02.txt");}
elseif ($id == "07"){
} readfile("7/01.txt");
elseif ($id == "08"){
readfile("8/01.txt");}
elseif ($id == "09")
readfile("9/01.txt");}
elseif ($id == "10"){
readfile("10/01.txt");}
elseif ($id == "11"){
readfile("11/01.txt");}
elseif ($id == "12"){
readfile("12/01.txt");}
?>
you should also use { and }I know I don't do it the more effecient way, but now it works.
Thanks!
Parse error: parse error, unexpected T_ELSEIF in C:\Inetpub\webpub\forecast\text\text_products.php on line 110
Here is my code:
<?php
If ($id == "01")
readfile("1/01.txt");
elseif ($id == "02")
readfile("2/01.txt");
elseif ($id == "06")
echo "<span style='color: 00FF00; font-size:15Pt; font-weight: bold'>Text Forecast</span>";
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>Adjala-Tosorontio</span>";
echo "<BR>";
readfile("../../f/textf/01.txt");
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>City of Barrie</span>";
echo "<BR>";
readfile("../../f/textf/02.txt");
elseif ($id == "07")
readfile("7/01.txt");
elseif ($id == "08")
readfile("8/01.txt");
elseif ($id == "09")
readfile("9/01.txt");
elseif ($id == "10")
readfile("10/01.txt");
elseif ($id == "11")
readfile("11/01.txt");
elseif ($id == "12")
readfile("12/01.txt");
?>
Line 110 is:
elseif ($id == "06")you should really use a switch statement instead of all those elseif's
but this should fix it
<?php
if ($id == "01"){
readfile("1/01.txt");
}
elseif ($id == "02"){
readfile("2/01.txt");
}
elseif ($id == "06"){
echo "<span style='color: 00FF00; font-size:15Pt; font-weight: bold'>Text Forecast</span>";
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>Adjala-Tosorontio</span>";
echo "<BR>";
readfile("../../f/textf/01.txt");
echo "<BR>";
echo "<BR>";
echo "<span style='color: F0E68C; font-weight: bold'>City of Barrie</span>";
echo "<BR>";
readfile("../../f/textf/02.txt");}
elseif ($id == "07"){
} readfile("7/01.txt");
elseif ($id == "08"){
readfile("8/01.txt");}
elseif ($id == "09")
readfile("9/01.txt");}
elseif ($id == "10"){
readfile("10/01.txt");}
elseif ($id == "11"){
readfile("11/01.txt");}
elseif ($id == "12"){
readfile("12/01.txt");}
?>
you should also use { and }I know I don't do it the more effecient way, but now it works.
Thanks!