php - error with submitting a form in wordpress -
i've created plugin (simple form) , shortcode.php file: <?php add_shortcode('contact_form','contact_form'); function contact_form(){ if (isset($_post['submit'])){ global $wpdb, $table_prefix; $name = $_post['name']; $data = array('name'=>$name,'message'=>'message'); $wpdb->insert($table_prefix.'contact_form',$data,array('%s','%s')); echo 'added'; } ?> <form method="post" action="" id="contact_form"> name: <input type="text" name="name"><br> <input type="submit" name="submit" value="submit"> </form> <?php } when submit form, if write sth in text field, says 'the page doesn't exist' if leave empty, submits form. problem? have used shortcode in page. see this question...