php help error message

February 20th, 2018

Alright I give up. Trying to add a guestbook feature to my crappy website. The guest book shows up fine, except the fonts are black on black and therefore not readable. When I try to edit the font or the background i get an error message. I’m a noob when it comes to this stuff, so if it’s obvious I don’t see it. And please don’t tell me to “google it”. I’ve been at this now two hours. Any help would be sweet.
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /www/110mb.com/l/u/c/k/y/b/e/a//htdocs/silentum/guestbook.php on line 4
Here is what the code looks like.
<html dir="ltr">
    <head>
        <?
   if($_GET["msg"] == "1") echo "<span style="color: #f00"><strong>ERROR: The maximum number of characters for a message is 255. Your message was <ins>".$_GET["l"]."</ins> characters.</strong></span><br /><br />";
   elseif($_GET["msg"] == "2") echo "<span style="color: #f00"><strong>ERROR: Your message cannot be added because a censored word ( <ins>".$_GET["cw"]."</ins> ) was detected.</strong></span><br /><br />";
   elseif($_GET["msg"] == "3") echo "<span style="color: #f00"><strong>ERROR: You must enter the correct verification code.</strong></span><br /><br />";
   elseif($_GET["msg"] == "4") echo "<span style="color: #f00"><strong>ERROR: You have already recently signed this guestbook.</strong></span><br /><br />";
   elseif($_GET["msg"] == "5") echo "<span style="color: #0f0"><strong>Thank you. Your message was added.</strong></span><br /><br />";
?>
    </head>
    <body bgcolor="#00fff0" spellcheck="false">
        <p>&nbsp;</p>
        <?
   if($_GET["msg"] == "1") echo "<span style="color: #f00"><strong>ERROR: The maximum number of characters for a message is 255. Your message was <ins>".$_GET["l"]."</ins> characters.</strong></span><br /><br />";
   elseif($_GET["msg"] == "2") echo "<span style="color: #f00"><strong>ERROR: Your message cannot be added because a censored word ( <ins>".$_GET["cw"]."</ins> ) was detected.</strong></span><br /><br />";
   elseif($_GET["msg"] == "3") echo "<span style="color: #f00"><strong>ERROR: You must enter the correct verification code.</strong></span><br /><br />";
   elseif($_GET["msg"] == "4") echo "<span style="color: #f00"><strong>ERROR: You have already recently signed this guestbook.</strong></span><br /><br />";
   elseif($_GET["msg"] == "5") echo "<span style="color: #0f0"><strong>Thank you. Your message was added.</strong></span><br /><br />";
?>
        <p>Pages:</p>
        <?php include("include.php") ?>  <hr />
        <h3>Sign Guestbook</h3>
        <form action="sign.php" method="post">
            <table cellspacing="10" cellpadding="15" border="2">
                <tbody>
                    <tr>
                        <td valign="top"><strong>Name</strong>:<br />
                        <input type="text" maxlength="35" name="name" size="50" /><br />
                        <br />
                        <strong>Email Address</strong>:<br />
                        <input type="text" maxlength="125" name="email" size="50" /><br />
                        <br />
                        <strong>Web Site</strong>:<br />
                        <input type="text" maxlength="125" name="uri" size="50" value="http://" /><br />
                        <br />
                        <strong>Message</strong>:<br />
                        <textarea cols="37" name="message" rows="5"></textarea></td>
                        <td valign="top"><strong>Verification Code</strong>:<br />
                        <img alt="" src="captcha.php" title="" /><br />
                        <br />
                        <strong>Repeat Verification Code <span style="background: rgb(255, 255, 255) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(255, 0, 0);">(Required)</span></strong>:<br />
                        (Five characters, case sensitive)<br />
                        <input type="text" maxlength="5" name="verification" size="5" /><input type="checkbox" name="check" style="visibility: hidden;" value="1" /><br />
                        <br />
                        <input type="submit" value="Sign Guestbook" /><br />
                        <br />
                        <hr />
                        Powered by: <a href="http://hypersilence.net" title="Silentum Guestbook v2.0.2">Silentum Guestbook v2.0.2</a><br />
                        <br />
                        <strong>:)</strong> <img alt=":)" src="images/smile.gif" style="padding: 0pt 15px 0pt 3px; vertical-align: middle;" title=":)" /> <strong>:(</strong> <img alt=":(" src="images/frown.gif" style="padding: 0pt 15px 0pt 3px; vertical-align: middle;" title=":(" /> <strong>;)</strong> <img alt=";)" src="images/wink.gif" style="padding: 0pt 15px 0pt 3px; vertical-align: middle;" title=";)" /> <strong>:D</strong> <img alt=":D" src="images/happy.gif" style="padding: 0pt 15px 0pt 3px; vertical-align: middle;" title=":D" /> <strong>:P</strong> <img alt=":P" src="images/tongue.gif" style="padding: 0pt 15px 0pt 3px; vertical-align: middle;" title=":P" /></td>
                    </tr>
                </tbody>
            </table>
        </form>
    </body>
</html>

The only thing I changed was the backround color. I don’t get it.

Answer #1
your syntax is not good

if ($a == 1) {
echo "something";
} elseif ($b != 1) {
echo "something else";
}

hope that helps

 

| Sitemap |