php - insert data in a wordpress database -
i'm developing wordpress plugin responsible getting data external html form , inserts in database. form code is:
<html> <body> <form action = "http://wp.istic.online/wp-content/plugins/news-apps/index.php" method = "post"> name: <input type = "text" name = "name" /> <input type = "submit" /> </form> </body> </html>
my plugin code is:
<?php
register($_post['name']); register($_post['name']);
function register($name) { global $wpdb; $wpdb->insert( 'gcm_tokens', array( 'token' => $name ), array( '%s' ) ); }
the data not inserted when try echo $name
variable works perfectly. when try echo after insert function it's not working.
any please?
use wp_nonce_field() below
<form> /* code */ <input type="hidden" name="action" value="new_post" /> <?php wp_nonce_field( 'new-post' ); ?> </form>
Thanks for give us valuable information
ReplyDeleteContact WordPress Support
WordPress Support Service
Very Helpful. Thanks for such Information
ReplyDeleteWP Support
WP Tech Support