What's wrong with this code:
<?php
if ($_GET['variable'] == "a") {
$variable = "a";
}
else {
$variable = "b"
}
echo $variable;
?>
I get an internal server error.
What's wrong with this code:
<?php
if ($_GET['variable'] == "a") {
$variable = "a";
}
else {
$variable = "b"
}
echo $variable;
?>
I get an internal server error.
Semicolon is missing in else part $variable.
For an explanation on what you did wrong look here: http://php.net/manual/en/getting-started.php
Mising a semicolon
Propably the missing
;
in line 6Because some other answer provide alternatives too
:)
You missed a semicolon here:
$variable = "b";
You forgot the trailing
;
on the$variable = "b"
line.