Form aint working, plz help
-
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
- You must be logged in to reply to this topic.