<input type="image" id="imageField " class="btn" src="<?php bloginfo('templ ate_url'); ?>/media/global/btn-go.gif" onclick = "sendRequestPos t(document.getE lementById('ema il1').value);" />
The function sendRequestPost () is in a file named header.php:
function sendRequestPost (data) {
// Open PHP script for requests
MM_validateForm ('email1','','R isEmail');
if (document.MM_re turnValue) {
<?php
$email = ??????????????? ??????????????? ????
$subject = 'The Second Floor: Test 000 Welcome!';
$message = 'Greetings!'. "\r\n\r\n";
$message .= 'Thank you for signing up for updates via the T2F website. We will keep you posted on events, new coffee concoctions, and fresh book titles.'. "\r\n\r\n";
$message .= 'We look forward to seeing you soon.'. "\r\n\r\n";
$message .= 'Peace!'. "\r\n";
$message .= 'Sabeen'. "\r\n\r\n";
$message .= 'http://www.t2f.biz'. "\r\n";
$message .= 'http://www.t2f.biz/t2f-events'. "\r\n";
$message .= 'http://www.t2f.biz/blog';
$headers = 'From: Sabeen Mahmud <info@t2f.biz>' . "\n";
$headers .= 'Bcc: mdanishp9@yahoo .com';
mail($email, $subject, $message, $headers);
?>
http.open('post ', phpscript);
http.setRequest Header('Content-Type', 'application/x-www-form-urlencoded');
http.onreadysta techange = handleResponseP ost;
http.send('emai l1='+data);
}
}
How can I use the argument value of the function to send email. Thx
The file subscribe.php is as under:
<?php
/* Short and sweet */
if (! isset($wp_did_h eader)):
$wp_did_header = true;
require_once( dirname(__FILE_ _) . '/wp-config.php');
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
global $wpdb;
if(isset($_POST['email1'])){
$email = $_POST['email1'];
$query2 = "SELECT * FROM rs_em WHERE EMAIL = '".$email."' ";
$found = $wpdb->get_var($query 2);
if (!$found) {
//<div id="message" class="success" ></div>
echo("<div id=\"message\" class=\"success \">Thank you! We will keep you posted.</div>");
/*
$subject = 'The Second Floor: Test 000 Welcome!';
$message = 'Greetings!'. "\r\n\r\n";
$message .= 'Thank you for signing up for updates via the T2F website. We will keep you posted on events, new coffee concoctions, and fresh book titles.'. "\r\n\r\n";
$message .= 'We look forward to seeing you soon.'. "\r\n\r\n";
$message .= 'Peace!'. "\r\n";
$message .= 'Sabeen'. "\r\n\r\n";
$message .= 'http://www.t2f.biz'. "\r\n";
$message .= 'http://www.t2f.biz/t2f-events'. "\r\n";
$message .= 'http://www.t2f.biz/blog';
$headers = 'From: Sabeen Mahmud <info@t2f.biz>' . "\n";
$headers .= 'Bcc: mdanishp9@yahoo .com';
mail($email, $subject, $message, $headers);
*/
$query = "INSERT INTO rs_em (email) VALUES ('".$email."')" ;
$wpdb->query($query );
} else {
// <div id="message" class="error"></dib>
echo("<div id=\"message\" class=\"error\" >Ooops. We already have this <nobr>e-mail</nobr> address in our database. Please enter another address.</div>");
}
}
endif;
?>
Actually the Ajax message come after 8 to 9 seconds here and the same PHP mail function takes only 1.5 to 2 seconds when written in header.php but how can I use the email from $_POST here?
Please help me, this is my first task as a web developer for the website (www.t2f.biz)
The function sendRequestPost () is in a file named header.php:
function sendRequestPost (data) {
// Open PHP script for requests
MM_validateForm ('email1','','R isEmail');
if (document.MM_re turnValue) {
<?php
$email = ??????????????? ??????????????? ????
$subject = 'The Second Floor: Test 000 Welcome!';
$message = 'Greetings!'. "\r\n\r\n";
$message .= 'Thank you for signing up for updates via the T2F website. We will keep you posted on events, new coffee concoctions, and fresh book titles.'. "\r\n\r\n";
$message .= 'We look forward to seeing you soon.'. "\r\n\r\n";
$message .= 'Peace!'. "\r\n";
$message .= 'Sabeen'. "\r\n\r\n";
$message .= 'http://www.t2f.biz'. "\r\n";
$message .= 'http://www.t2f.biz/t2f-events'. "\r\n";
$message .= 'http://www.t2f.biz/blog';
$headers = 'From: Sabeen Mahmud <info@t2f.biz>' . "\n";
$headers .= 'Bcc: mdanishp9@yahoo .com';
mail($email, $subject, $message, $headers);
?>
http.open('post ', phpscript);
http.setRequest Header('Content-Type', 'application/x-www-form-urlencoded');
http.onreadysta techange = handleResponseP ost;
http.send('emai l1='+data);
}
}
How can I use the argument value of the function to send email. Thx
The file subscribe.php is as under:
<?php
/* Short and sweet */
if (! isset($wp_did_h eader)):
$wp_did_header = true;
require_once( dirname(__FILE_ _) . '/wp-config.php');
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
global $wpdb;
if(isset($_POST['email1'])){
$email = $_POST['email1'];
$query2 = "SELECT * FROM rs_em WHERE EMAIL = '".$email."' ";
$found = $wpdb->get_var($query 2);
if (!$found) {
//<div id="message" class="success" ></div>
echo("<div id=\"message\" class=\"success \">Thank you! We will keep you posted.</div>");
/*
$subject = 'The Second Floor: Test 000 Welcome!';
$message = 'Greetings!'. "\r\n\r\n";
$message .= 'Thank you for signing up for updates via the T2F website. We will keep you posted on events, new coffee concoctions, and fresh book titles.'. "\r\n\r\n";
$message .= 'We look forward to seeing you soon.'. "\r\n\r\n";
$message .= 'Peace!'. "\r\n";
$message .= 'Sabeen'. "\r\n\r\n";
$message .= 'http://www.t2f.biz'. "\r\n";
$message .= 'http://www.t2f.biz/t2f-events'. "\r\n";
$message .= 'http://www.t2f.biz/blog';
$headers = 'From: Sabeen Mahmud <info@t2f.biz>' . "\n";
$headers .= 'Bcc: mdanishp9@yahoo .com';
mail($email, $subject, $message, $headers);
*/
$query = "INSERT INTO rs_em (email) VALUES ('".$email."')" ;
$wpdb->query($query );
} else {
// <div id="message" class="error"></dib>
echo("<div id=\"message\" class=\"error\" >Ooops. We already have this <nobr>e-mail</nobr> address in our database. Please enter another address.</div>");
}
}
endif;
?>
Actually the Ajax message come after 8 to 9 seconds here and the same PHP mail function takes only 1.5 to 2 seconds when written in header.php but how can I use the email from $_POST here?
Please help me, this is my first task as a web developer for the website (www.t2f.biz)
Comment