Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $wpdb, $wp_hasher;
- define('WP_USE_THEMES', false);
- require_once('./wp-load.php');
- $siteUser = $_COOKIE['siteUser'];
- $fname = $_COOKIE['fname'];
- $lname = $_COOKIE['lname'];
- $email = $_COOKIE['email'];
- $phoneNum = $_COOKIE['pno'];
- $address = $_COOKIE["address"];
- $unit = $_COOKIE['unit'];
- $bedrooms = $_COOKIE['bedrooms'];
- $bathrooms = $_COOKIE['bathrooms'];
- $condition = $_COOKIE['condition'];
- $wpdb->insert('userQuery',
- //new data
- array(
- 'First Name' => $fname,
- 'Last Name' => $lname,
- 'Email Address' => $email,
- 'Phone Number' => $phoneNum,
- 'Property Address' => $address,
- 'UNIT #' => $unit,
- 'Bedrooms' => $bedrooms,
- 'Bathrooms' => $bathrooms,
- 'Condition' => $condition,
- 'user' => $siteUser
- ));
- $to[] = 'info@sickwebmedia.com';
- $to[] = 'tousifosman@gamil.com';
- $to[] = 'shawn@sickwebmedia.com';
- $to[] = 'info@valuetargeting.com';
- $emailList = $wpdb->get_results(
- "
- SELECT user_email
- FROM wp_users
- "
- );
- foreach ( $emailList as $email )
- {
- $to[] = $email->user_email;
- }
- $message = 'First Name : ' . $fname
- .'<br />Last Name : ' . $lname
- .'<br />Email Address : ' . $address
- .'<br />Phone Number : ' . $phoneNum
- .'<br />Property Address : ' . $address
- .'<br />UNIT # : ' . $unit
- .'<br />Bedrooms : ' . $bedrooms
- .'<br />Bathrooms : ' . $bathrooms
- .'<br />Condition : ' . $condition;
- $headers[] = 'Content-Type: text/html; charset=UTF-8';
- $headers[] = 'From: valuetargeting <info@valuetargeting.com>' . "\r\n";
- if (!wp_mail( 'tousifosman@gmail.com', 'New Request', $message, $headers)) {
- echo 'Mail not Sent';
- exit(1);
- }
- wp_redirect( home_url().'/thank-you/' ); exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement