How to insert form data in MySql database Wordpress
<?php
require_once('/wp-config.php');
global $wpdb;
if ( isset( $_POST['submit'] ) ){
$wpdb->insert( 'wp_post_job', array(
'fname' => $_POST['fname'],
'lname' => $_POST['lname'],
'email' => $_POST['email'],
'city' => $_POST['city'],
array( '%s', '%s', '%s', '%s')
);
}
?> <?php get_header(); ?>
<form action="" id="postjob" method="post">
<input type="text" name="organizationname" id="organizationname" value="/>
<input type="text" name="organizationname" id="organizationname" value="/>
<input type="text" name="organizationname" id="organizationname" value="/>
<input type="text" name="organizationname" id="organizationname" value="/>
</form>
<?php get_footer(); ?>
0 comments:
Post a Comment
Thanks