Click to See Complete Forum and Search --> : if you could spare the time with unexpected $end error


linoukus
12-12-2007, 07:03 PM
this error keep opoing up, which is anouying because well it doesn't really explain what wrong so i can fix it, so any help would be useful. it is meant to be a basic admin page for a website, so people can add news to it with out accessing the host server

<?php
/* Include Files *********************/
session_start();
include("sub/subDatabase.php");
include("sub/subList.php");
include("sub/subAddnews.php");
include("sub/subDelete.php");
include("sub/subDeleteall.php");
/*************************************/
?><html>
<body>
<?php
/****************** menu *********************************/
?>
<table border="1" align="center">
<tr>
<td>
<?php print "<a href=\"admin.php?action=list\">List News</a>&nbsp;"; ?>
</td>
<td>
<?php print "<a href=\"admin.php?action=add\">Add News</a>&nbsp;"; ?>
</td>
<td>
<?php print "<a href=\"admin.php?action=del\">Delete News</a>&nbsp"; ?>
</td>
<td>
<?php print "<a href=\"admin.php?action=delall\">Delete all News</a>&nbsp"; ?>
</td>
<td>
<?php print "<a href=\"admin.php?action=edit\">Edit News</a><br>"; ?>
</td>
</tr>
</table>
<table width="70%" height="90%" border="1" align="center">
<tr>
<td><h1>
<?php
/************************** List News **********************************/

if (isset($action) && $action == 'delall'){ deleteall(); }

/*********************** End of List News ******************************/

/************************** Add News ***********************************/

if (isset($action) && $action == 'add') {
?>
<form action="insert.php" method="post">
title <input type="text" name="title" />
content: <input type="text" name="news" height="50px"/>>
<input type="submit" />
</form>
<?php
}

/************************ End Add News *******************************/

/********************** Delete all record **********************/

if (isset($action) && $action == 'delall') { deleteall(); }

/******************** end of delete all ****************/

/********************* delete a record *****************/

if (isset($action) && $action == 'del') { delete(); }

/********************** end of delete a record ***************/
?></h1>
</td>
</tr>
</table>

linoukus
12-12-2007, 07:14 PM
ok, nevermind, i found the problem it was a '}' on line 55 that was not inside a <?php ?> tag. which i atturly found with theying to work out how to use this website tag system lol.

But please any comment or surgestion people have to make my code better would be helpful, because i think mine is slighty limited

bradgrafelman
12-13-2007, 03:45 AM
Moved thread to Code Critique... also, there's no need to mix the PHP and HTML tags every time your code changes from one to the other; if your code contains PHP code, just use the PHP bbcode tag.