redirect( pending.php ); break; If the article ID was passed, (Apache web server for windows)
redirect( pending.php ); break; If the article ID was passed, and the comment field is filled in, process this transaction. case Submit Comment : if (isset($_POST[ article ]) and $_POST[ article ] and isset($_POST[ comment ]) and $_POST[ comment ]) { Insert the article ID, the comment date (in MySQL datetime format), the user ID, and the actual comment into the database. When this has been accomplished, redirect the user to the article so he or she can see the newly saved comment. $sql = INSERT INTO cms_comments . (article_id,comment_date,comment_user,comment) . VALUES ( . $_POST[ article ] . , . date( Y-m-d H:i:s ,time()) . , . $_SESSION[ user_id ] . , . $_POST[ comment ] . ) ; mysql_query($sql, $conn) or die( Could add comment; . mysql_error()); } redirect( viewarticle.php?article= . $_POST[ article ]); break; This is a case where the action is passed in the URL (?action=remove&article=123). Verify that the article ID was passed and that the user is logged in. case remove : if (isset($_GET[ article ]) and isset($_SESSION[ user_id ])) { You currently allow only users to delete their own articles. You might modify this transaction to allow moderators and admins to delete any article, but for now only users can delete the articles they have written. $sql = DELETE FROM cms_articles . WHERE article_id= . $_GET[ article ] . AND author_id= . $_SESSION[ user_id ]; mysql_query($sql, $conn) or die( Could not remove article; . mysql_error()); } redirect( cpanel.php ); break; Once again, don t forget to close your switch statement: } 443 Building a Content Management System
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.