Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: myTemp
- */
- global $wpdb;
- if ( isset( $_POST['address'] ) && $_POST['address'] != '') {
- $address = $_POST['address'];
- }
- // grab the table if exist or build and store in var
- $address_table = $wpdb->prefix . "address_table";
- $wpdb->insert($address_table, array('address' => $address),array('%s'));
- if( isset($address) && $address != '' ) {
- echo 'Thank you, address has been submitted';
- }
- ?>
- <form method="post" action="" id="insertForm" name="insertForm">
- <input type="text" value="" placeholder="enter text" id="address" name="address">
- <input type="submit" value="submit">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement