PHP第14行语法错误我认为字符串错误

时间:2013-01-20 14:04:00

标签: php html

我添加了几个脚本到我的流因为我在网站上工作但我在第14行因某种原因继续出现错误$ User_id;不工作我已多次浏览脚本,但无法找到错误,它是一个语法错误,但没有告诉我很多原因我不是PHP的专业人士,但我知道很多那些人:D但无论如何请帮助:)。

<?php
include('settings.php');
//Made by Arnem\\
//Settings.php\\
$closed = 2000; //format of time the stream usualy closes\\
$closed2 = '20:00'; //format of same as $closed but with : in the middle of hours : minutes\\
$opend = 1500; //format of time when the stream usualy starts\\
$opend2 = '15:00'; //format of same as $opend but with : in the middle of hours : minutes\\

$openmsg = '<p class=customfont>Streaming status: Online</p>'; //Streaming Online Message\\
$closemsg = '<h1 class=customfont2>Streaming is currently offline!</h1>'; //closed message\\
$closemsg2 = 'Streaming status: Offline'; //Streaming offline message\\
$Streamer_msg = 'Streamer:'; //Message of streamer\\
$Streamer_error = 'ERROR, user not found.'
$User_id = '2';
$userid1 = 'Arnem'; //User that streams songs\\
$userid2 = 'DJ Trolli';
$userid3 = 'Mr. Nobody';
$userid4 = '';
$userid5 = '';
$usr_None = 'None';
$userid = $User_id;
//End of Settings.php\\
//DO NOT CONFIGURE UNDER THIS LINE!\\
$Streamermssg = $Streamer_msg . ' ';
$Streamererror = $Streamer_msg . '';
if ($usersid == NULL) {
$user1 = '<p class=customfont>' . $Streamermssg . $usr_None . '</p>';
} elseif ($usrid == '1') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid1 . '</p>';
} elseif ($userid == '2') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid2 . '</p>';
} elseif ($userid == '3') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid3 . '</p>';
} elseif ($userid == '4') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid4 . '</p>';
} elseif ($userid == '5') {
$user1 = '<p class=customfont>' . $Streamermssg . $userid5 . '</p>';
} else {
$user1 = '<p class=customfont>' . $Streamererror . '</p>';
}

$openmsg3 = '<p class=customfont>' . $openmsg;
$closemsg3 = '<h1 class=customfont2>' . $closemsg;
$closemsg4 = '<p class=customfont>' . $closemsg2 . '</p>';

//Re Configure script\\
$time = gmdate(H)+1 . gmdate(i);

if ($time>$closed) {
$streamer = $Streamermsg . $usr_None . '</p>';
$status1 = $closemsg3;
$status2 = $closemsg4;
} elseif ($time<$opend) {
$streamer = $Streamermsg . $usr_None . '</p>';
$status1 = $closemsg3;
$status2 = $closemsg4;
} else {
$streamer = $Streamermsg2 . $user1;
$status2 = $openmsg3;
}

?>
<!--HTML CODE -->
<html>
<center>
<h1 class="customfont">Welcome to my Stream</h1>
<head>

<title>Sound of Songs</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="swfobject.js"></script>

<style type="text/css">
@font-face {
        font-family: "My Custom Font";
        src: url(http://enderman.tk/stream/custom.ttf) format("truetype");
}
@font-face {
        font-family: "My Custom Font2";
        src: url(http://enderman.tk/stream/custom2.ttf) format("truetype");
}
p.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
h1.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
h2.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
a.customfont {
        font-family: "My Custom Font";
        color: #ffffff;
}
a.customfont:hover {
        font-family: "My Custom Font";
        color: #000000;
}
a.customfont:visited {
        font-family: "My Custom Font";
        color: #3399CC;
}
h1.customfont2 {
        font-family: "My Custom Font";
        color: #FF0000;
}
body
{
background-color: #2c85c7;
}
</style>
<!--FLASH CONTENT-->

</head>
<body>
<div id="flashcontent2">
        <p>
        <strong>Sorry this site have a flash based native radio and needed adobe flash 10+ support. </strong><br />
            <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Download Flash here.</a>
    </p>
</div>

<script type="text/javascript">
        // <![CDATA[

        var so = new SWFObject("nativeradio2small.swf", "nativeradio2small", "300", "50", "10", "#cccccc");
        so.addParam("scale", "noscale");
        so.addVariable("swfcolor", "2c85c7");
        so.addVariable("swfwidth", "300");
        so.addVariable("swfradiochannel", "Sound of Songs");
        so.addVariable("swfstreamurl", "http://enderman.tk:1234");
        so.addVariable("swfpause", "1");
        so.write("flashcontent2");

        // ]]>
</script>
<p></p>
</body>
<?php echo $status1; ?>
<p class="customfont">Mixes: DJ Trolli</p>
<p class="customfont">Songs found by Arnem</p>
<p class="customfont">And played by Arnem</p>
<p class="customfont">Love from Arnem & DJ Trolli!</p>
<p class="customfont">Stream is up at <?php echo $opend2; ?> - <?php echo $closed2; ?> GMT +1</p>
<?php echo $status2; ?>
<?php echo $streamer; ?>

<br />
<h2 class="customfont">Special Message for our Listeners :)</h2>
<p class="customfont">Want more of DJ Trolli?</p><a href="https://soundcloud.com/djtrolli" class="customfont"> Click Here :)</a>

</center>
</html>

3 个答案:

答案 0 :(得分:1)

第14行应该是这样的(最后用分号):

$Streamer_error = 'ERROR, user not found.' ;

请查看Web服务器error.log以获取错误消息。

答案 1 :(得分:0)

你错过了之前的;

$Streamer_error = 'ERROR, user not found.';
//       semi-colon missing here ---------^

答案 2 :(得分:0)

您忘记按;分号

关闭该句子

请从下面的行中替换该行: -

$Streamer_error = 'ERROR, user not found.';