<?php
//global $wpdb;
/*
Plugin Name:new plugin
Description: A simple hello world wordpress plugin
Version: 1.0
Author: arti shrivas
Author URI: http://yourdomain.com
License: GPL
*/
/* This calls hello_world() function when wordpress initializes.*/
//Note that the hello_world doesnt have brackets.
add_action('init','new_plugin');
function new_plugin()
{
//echo "Hello World";
global $wpdb;
$table_name ='wp_register';
if(isset($_POST['sub']))
{
// echo "hello";
$name=$_POST['name'];
$dob=$_POST['dob'];
$email=$_POST['email'];
// echo $name." ".$dob." ".$email;
$wpdb->insert(
$table_name,
array(
'name' => $name,
'dob' => $dob,
'email'=>$email
),
array(
'%s',
'%s',
'%s'
)
);
//$wpdb->query("INSERT INTO $table_name (name, dob,email) VALUES('".$name."','".$dob."','".$email."')");
// echo '<pre>';print_r($wpdb); die;
}
if(is_page('132')){
?>
<div class="new">
<div class="new1">
<form method="post" >
<?php //wp_nonce_field('update-options'); ?>
<lable>Your name</lable> <input type="text" name="name"><br/>
<lable>Date of birth</lable> <input type="text" name="dob"><br/>
<lable>Email id</lable><input type="text" name="email">
<br/>
<input type="submit" value="<?php _e('Save Changes') ?>" name="sub"/>
</form>
</div>
</div>
<?php
}
}
?>
i am new to wp and i am try to create an simple registration plugin everythig is right but when i submit page it gives me a message
"This is somewhat embarrassing, isn’t it?
It seems we can’t find what you’re looking for. Perhaps searching can help."
what i am doing wrong plz help me
thanx in advance