on this script i keep getting this error Parse error: syntax error, unexpected $end in C:\Program Files\xampp\htdocs\xampp\Sites\Band\Templates\forum.php on line 55 (line 55 is the last line </form> line )
also i was wondering if its possible to make a blog scpirt like this that shows the form, shows the other entered blogs, and shows an edit and delete button for each all on the same script. right now i ahve the add and view parts in this script and the delete on the other...no idea if it worx though because i cant test it due to the last error.Code:<?php if (isset ($_POST['submit'])) { if ($dbc = @mysql_connect ('localhost', 'root', '')) { if (!@mysql_select_db ('forum')) { die ('<p>Could not select the database because: <b>' . mysql_error() . '</b></p>'); } $query = "INNSERT INTO forum_entries (blog_id, title, entry, date_entered) VALUES (0, '{$_POST['title']}', '{$_POST['entry']}', NOW())"; if (@mysql_query ($query)) { echo '<p>The blog entry has been added.</p>'; } else { echo "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $query</p>"; } } mysql_close(); if ($dbc = @mysql_connect ('localhost', 'root', '')) { if (!@mysql_select_db ('forum')) { die ('<p>Could not select the database because: <b>' . mysql_error() . '</b></p>'); } $query = 'SELECT * FROM forum_entries ORDER BY date_entered ASC'; if ($r = mysql_query ($query)) { while ($row = mysql_fetch_array ($r)) { echo "<p><h3>{$row['title']}</h3>{$row['entry']}<br /> <a href=\"forum.php?id={row['forum_id']}\">Edit</a> <a href=\"delete_entry.php?id={$row['blog_id']}\">Delete</a> </p><hr />\n"; } } else { die ('<p>Could not retrieve the data because: <b>' . mysql_error() ."'</b>The query was $query</p>"); } mysql_close(); ?> <form acrtion="forum.php" method="post"> <p>Entry Title: <input type="text" name="title" size="40" maxsize="100" /><br /> Entry Text: <textarea name="entry" columns="40" rows="5"></textarea></p> <input type="submit" name="submit" value="Add to the Forum!" /> </form>





Reply With Quote