Insert data from form

<?php
if(isset($_POST[‘submit’])){
$wpdb->insert(
‘wp_form’,
array(
‘fname’ => $_POST[‘fname’],
’email’ => $_POST[’email’],
‘message’ => $_POST[‘message’]
),
array(
‘%s’,
‘%s’,
‘%s’,
));
}
?>
<form id=”appointment” name=”appointment” method=”post”>
<fieldset>
<div class=”form-group”>
<input type=”text” placeholder=”Name” name=”fname”  />
</div>
<div class=”form-group”>
<input type=”text” placeholder=”E-mail” name=”email” />
</div>
<div class=”form-group”>
<input type=”text” placeholder=”message” name=”message”  />
</div>
<input type=”submit” name=”submit” class=”btn-subscribe” value=”Submit” />
</fieldset>
</form>

Advertisements

Tagged: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: