Parse error: parse error, unexpected $end on line 57
and the only thing on line 57 is ?> but line 57 is the last line:
Code: Select all
<?php
//assign the block to show to the $display_block variable
if ($show_form == "yes") {
//build form block
$display_block ="
<h1>Login</h1>
<form method=POST action="$_SERVER[PHP_SELF]">
$msg
<P><strong>username:</strong><br>
<input type="text" name="username" size=15 maxlength=25></P>
<P><strong>password:</strong><br>
<input type="password" name="password" size=15 maxlength=25></P>
<input type="hidden" name="op" value="ds">
<P><input type="submit" name="submit" value="login"></P>
</FORM>";
} else if ($show_menu == "yes") {
//set up table and database names
$db_name ="Inventory";
$table_name ="client_hardware";
//connect to server and select database
$connection = @mysql_connect("localhost","byron","byronb") or die(mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());
//build and issue query
$sql = "SELECT count(user_id) FROM $table_name";
$result = @mysql_query($sql,$connection) or die(mysql_error());
$count = @mysql_result($result,0,"count(user_id)") or die(mysql_error());
//get current date
$today = date("l,F jS,Y");
//build menu block
$display_block ="
<p><em>Today is $today</em></p>
<P><strong>Miscellaneous</strong></P>
<ul>
<li>Records in system: <strong>$count</strong>
</ul>
<P><strong>Inventory</strong><ul>
<li><a href="index.php?main=show_addrecord" style="text-decoration:none">Add a Record</a>
<li><a href="index.php?main=pick_modrecord" style="text-decoration:none">Modify a Record</a>
<li><a href="index.php?main=pick_delrecord" style="text-decoration:none">Delete a Record</a>
</ul>
<P><strong>View Records</strong>
<ul>
<li><a href="index.php?main=show_recordsbyname" style="text-decoration:none">Ordered by user_name</a>
</ul>
}
?>