comments.php
No notes
Syntax:
PHP
<? //Manage requests if(!$_POST['action']) { header ("Location: comments.html"); } else { $connect = connect(HOST, USER, PASSWORD); switch($_POST['action']){ //Case Updating the code case "update": $sqlQuery = getComments($connect, 20); while($row = mysql_fetch_array($sqlQuery)) { $result .= "<li><img src=\"/images/commentIcon.png\" alt=\"\" /> <span class=\"commentName\">".$row['name']." </span><span class=\"commentDate\"> @".$row['date']."</span> <br /><br /><hr /><br /><span class=\"commentText\"> ".$row['comment']."</span><br /><br /></li>"; } echo $result; break; //Case Inserting Data case "insert": echo insertComment($_POST['name'], $_POST['comment']); break; } mysql_close($connect); } ?>