Location: PHPKode > scripts > WH Board > wh_board/admin/topics_delete.php
<?php require('management/admin_functions/session.php'); ?>
<?php require('management/admin_layout/header.php'); ?>

    <ul id="breadcrumbs">
        <li><a href="index.php"><?php echo $lang['main_navigation']; ?></a></li>
        <li><a href="topics.php"><?php echo $lang['manage_topics']; ?></a></li>
        <li><a href="topics_delete.php" class="actual"><?php echo $lang['delete_topics']; ?></a></li>
    </ul>

    <div class="clear_blog"></div>

    <?php

    if((isset($_GET['topic_id'])) && (is_numeric($_GET['topic_id']))) {

	$id = mysql_real_escape_string($_GET['topic_id']);
	$id = intval($_GET['topic_id']);

		}else{

		echo '<p class="false">' . $lang['invalid_id'] . '!</p>';
		}

    $query = "DELETE FROM topics WHERE topic_id = '" . $id . "'";
    $result = mysql_query($query) OR die(mysql_error());

    $sql = "DELETE FROM posts WHERE post_topic = '" . $id . "'";
    $result2 = mysql_query($sql) OR die(mysql_error());

    if($result && $result2) {

    echo '<p class="success">' . $lang['success_delete_topic'] . '!</p>
    <p><a href="topics.php">' . $lang['go_on'] . '</a></p>';

    	}else{

    	echo '<p class="false">' . $lang['failed_delete_topic'] . '</p>
        <p><a href="topics.php">' . $lang['back'] . '</a></p>';
    	}

    ?>

<?php require('management/admin_layout/footer.php'); ?>
Return current item: WH Board