My PHP code dosen’t work for some reason, I get an error on elseif. I can’t really figure it out because I’ve never used elseif but I’ve saw at YouTube you can use it but I really want some help to figure this one out, but it worked fine before i set $status1-2 = closedmsg1-2.
Do you know the answer or another way to do the $status1-2 = closedmsg1-2?
I’ve also searched a bit for “String Replacer” or “String Set” but i can’t find it.
<?php
//Made by Arnem\\
//\\Options//\\
$closed = 2000;
$opend = 1500;
$openmsg = '<p class=customfont>Streaming status: Online</p>';
$closemsg = '<h1 class=customfont2>Streaming is currently offline!</h1>';
$closemsg2 = '<p class=customfont>Streaming status: Offline</p>';
//DO NOT CONFIGURE UNDER THIS LINE!\\
$time = gmdate(H)+1 . gmdate(i);
if ($time>$closed)
$status1 = $closemsg;
$status2 = $closemsg2;
elseif ($time<$opend)
$status1 = $closemsg;
$status2 = $closemsg2;
else
$status2 = $openmsg;
echo$status1;
echo $status2;
?>
Try
You were missing the braces
{}. The only time you can go without them is when its a single statement if/else.