bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Form aint working, plz help

(1 post)
  • Started 1 year ago by Null
  • This topic is not a support question

No tags yet.

  1. Well I've created this form but it aint updating the db. What am I doing wrong?

    function update_portal($number_of_topics) {
    global $bbdb, $bb_table_prefix;
    $bbdb->query("UPDATE ".$bb_table_prefix."portal SET number_of_topics = '$number_of_topics'");
    }
    if ($_SERVER['REQUEST_METHOD'] == "POST")
    {
    update_portal($_POST['number_of_topics']);
    }
    // Show form
    function portal_form() {
    ?>
    <h2><?php _e('Management'); ?></h2>
    <form action="" method="post">
    <?php do_action('update_portal',''); ?>
    <h3><?php _e('Portal settings'); ?></h3>
    <table>
    <tr><th scope="row"><?php _e('Number of topics on the portal:'); ?></th>
    <td><input type="text" name="number_of_topics" id="number_of_topics" /></td>
    </tr>
    </table>
    <p class="submit alignleft"><input type="submit" value="Submit" name="submit">
    </form>
    <?php
    }

    Thx

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.