if (isset($_REQUEST[ action ])) { switch ($_REQUEST[ action ]) { case Submit (Web hosting isp)

if (isset($_REQUEST[ action ])) { switch ($_REQUEST[ action ]) { case Submit New Article : if (isset($_POST[ title ]) and isset($_POST[ body ]) and isset($_SESSION[ user_id ])) { $sql = INSERT INTO cms_articles . (title,body, author_id, date_submitted) . VALUES ( . $_POST[ title ] . , . $_POST[ body ] . , . $_SESSION[ user_id ] . , . date( Y-m-d H:i:s , time()) . ) ; mysql_query($sql, $conn) or die( Could not submit article; . mysql_error()); } redirect( index.php ); break; case Edit : redirect( compose.php?a=edit&article= . $_POST[ article ]); break; case Save Changes : if (isset($_POST[ title ]) and isset($_POST[ body ]) and isset($_POST[ article ])) { $sql = UPDATE cms_articles . SET title= . $_POST[ title ] . , body= . $_POST[ body ] . , date_submitted= . date( Y-m-d H:i:s , time()) . . WHERE article_id= . $_POST[ article ]; if (isset($_POST[ authorid ])) { $sql .= AND author_id= . $_POST[ authorid ]; } mysql_query($sql, $conn) or die( Could not update article; . mysql_error()); } if (isset($_POST[ authorid ])) { redirect( cpanel.php ); } else { redirect( pending.php ); } break; case Publish : if ($_POST[ article ]) { $sql = UPDATE cms_articles . SET is_published=1, date_published= . date( Y-m-d H:i:s ,time()) . . 438 Chapter 13
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Leave a Reply