admin管理员组

文章数量:1317906

Hello I having a strange behavior with a simple submit in a page that has to fill some data from 2 inputs. Basically every time i try inserting without values it insert, if i try and put 'teste1' it inserts but it doesn't insert anything than that values more.

down i have the code i'm using for the delete and insert:

if (isset($_POST['addit'])) {
    $wpdb->insert($table_name, array(
        'names' => $_POST['name'],
        'descriptions' => $_POST['description']
    ));
} elseif(isset($_POST['deleteit'])) {
    if ($_POST['deleteid']) {
        $wpdb->delete($table_name, array('id'=>$_POST['deleteid']));
    }
}
$categories = $wpdb->get_results($sql);

heres the parte where I use it, i have to say that i dont have problemas with the delete option.

 <tbody>
                <tr class="alternate">
                    <td>
                    </td>
                    <td>
                        <input type="text" id="name" name="name" value="">
                    </td>
                    <td>
                        <input type="text" id="description" name="description" value="">
                    </td>
                    <td>
                    </td>
                    <td>
                    <input type="submit" class="button"  name="addit" value="">Actualizar</input>
                    </td>
                </tr>
            </tbody>

this is only happening in a specific template i created on WordPress and not in the others that have a similar construction. Already tried recreating the page, configuring a new page.Its a veru simple insert and delete and delete One more thing its strange, every time i put some other string, it goes to the standard 404 WordPress page. Any Thought?

Best Regards

本文标签: databaseSubmiting with problems on one of the options php wprdpress