Location: PHPKode > scripts > WH Board > wh_board/admin/badwords.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="badwords.php" class="actual">Badwords</a></li>
    </ul>

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

    <?php

    if($_SERVER['REQUEST_METHOD'] != 'POST') {

    echo '<form action="" method="post" name="badword">
    <p><input type="text" name="badword_word" id="badword_word" class="textfields" size="40"> ' . $lang['new_badword'] . '</p>
    <input type="submit" name="submit" id="submit" class="buttons" alt="' . $lang['add_word'] . '" value="' . $lang['add_word'] . '">
    </form></p><br>';

        }else{

        $badword_word = htmlentities($_POST['badword_word']);

        $sql = "INSERT INTO `badwords` (`badword_word`) VALUES('" . mysql_real_escape_string($badword_word) . "')";

        mysql_query($sql);

        if(mysql_affected_rows() == 1) {

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

            }else{

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

    $count_words = mysql_query("SELECT badword_id FROM badwords") OR die(mysql_error());
    $sum_words = mysql_num_rows($count_words);

    echo '<p class="green">' . (int)$sum_words . ' ' . $lang['words_in_list'] . '</p>
    <div class="spacer"></div>';

    $query = "SELECT * FROM badwords";
    $result = mysql_query($query) OR die(mysql_error());

    if($result) {

    echo '<table width="100%" class="tables">
    <tr>
    <td width="5%"><strong>ID</strong></td>
    <td width="85%"><strong>Badword</strong></td>
    <td width="10%" align="center"><strong>' . $lang['blank_delete'] . '</strong></td>
    </tr>';

    while($row = mysql_fetch_assoc($result)) {

        echo '<tr>
        <td width="5%">' . (int)$row['badword_id'] . '</td>
        <td width="85%">' . htmlentities($row['badword_word'], ENT_QUOTES) . '</td>
        <td width="10%" align="center"><a href="badwords_delete.php?id=' . (int)$row['badword_id'] . '"><img src="../style/images/admin/icons/delete.png" alt="' . $lang['blank_delete'] . '" title="' . $lang['blank_delete'] . '" border="0"></a></td>
        </tr>';
        }

    echo '</table>';

    }else{

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

    ?>

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