- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Im getting an unexpected T_ELSE and I cant figure it out. Any help appreciated.
ID, "video", true))) { ?>
ID, "video", true); ?>
ID, "image", true))) { ?>
$images = array(
'example.jpg',
'example.jpg',
'example.jpg',
);
$image = $images[array_rand($images)];
$output = "";
echo $output;
?>
$image = $images[array_rand($images)];
only needs to be
$image = array_rand($images);
still getting same error.
Is this the only code? It seems like your if/else statement is being broken. Is there additional code or hidden characters between the close of the if and the start of the else if statement?
Can you remove the php tags and seemingly blank line that separate them so you end up with } else if { to see if that fixes it?
Other then some divs for styling. That is it. and I tried you suggestion on the $image, but it did not work. Thanks for taking the time to look at it. For now, I just changed the “else if” to an “if”.
That’s because I’m pretty sure it’s ‘elseif’, not ‘else if’. I’m a PHP noob, though!
You would be correct unless you use curly brackets which I did. But elseif is the correct format. :)