Code:
/*===================================================
ShowFormSpider()
===================================================*/
function ShowFormSpider() {
// vars global configuration
global $dbConn, $theme_path;
// vars url & form
global $u, $lid, $revid, $looking, $spelling, $to;
// vars messages
global $msg;
// vars template
global $error_msg, $email, $name, $looking, $spelling, $body;
if ($u) {
$to = $u;
}
elseif ($lid) {
$to = $dbConn->Lookup('contact_name', 'idx_link', "link_id = '$lid'");
}
elseif ($revid) {
$to = $dbConn->Lookup('username', 'idx_review', "review_id = '$revid'");
if (!$to) {
$to = $dbConn->Lookup('name', 'idx_review', "review_id = '$revid'");
}
}
$name = stripslashes($name);
$body = stripslashes($body);
$email = stripslashes($email);
$looking = stripslashes($looking);
$spelling = stripslashes($spelling);
DisplayTemplate($theme_path . "spider_form.html", "\$error_msg,\$email,\$name,\$looking,\$spelling,\$to,\$u,\$lid,\$revid,\$body");
}
/*===================================================
ProcessFormSpider()
===================================================*/
function ProcessFormSpider() {
// vars global configuration
global $dbConn, $theme_path;
// vars url & form
global $error_msg, $email, $name, $looking, $spelling, $u, $lid, $revid, $to, $body;
// vars messages
global $msg;
// vars template
global $error_msg;
// verify input
$name = stripslashes($name);
$body = stripslashes($body);
$email = stripslashes($email);
$looking = stripslashes($looking);
$spelling = stripslashes($spelling);
if (empty($email))
$error_msg = $msg["10282"];
elseif (!IsEmailAddress($email))
$error_msg = $msg["10283"];
elseif (empty($name)) {
$error_msg = $msg["20400"];
}
elseif (empty($looking)) {
$error_msg = $msg["20500"];
}
elseif (empty($spelling)) {
$error_msg = $msg["20501"];
}
elseif ($_POST['captcha_key'] != $_SESSION['captcha_key'])
$error_msg = $msg["10120"];
if (empty($error_msg)) {
if ($u) {
$users_obj = new clsUsers;
$users_obj->table_name = "idx_users";
$email_to = $users_obj->GetEmailAddress($u);
}
elseif ($lid) {
$email_to = $dbConn->Lookup('email', 'idx_link', "link_id = '$lid'");
}
elseif ($revid) {
$email_to = $dbConn->Lookup('email', 'idx_review', "review_id = '$revid'");
if (!$email_to) {
$to = $dbConn->Lookup('username', 'idx_review', "review_id = '$revid'");
$users_obj = new clsUsers;
$users_obj->table_name = "idx_users";
$email_to = $users_obj->GetEmailAddress($to);
}
}
$email_from = $email;
$from = $name . "<$email_from>";
@mail($email_to, $name, $body, "From: $from \nX-Mailer: INDEXU_X-Mailer/1.0");
DisplayTemplate($theme_path . "spider_ok.html", "\$to,\$u");
}
else {
ShowFormSpider();
}
}
/*===================================================
main
===================================================*/
include "application.php";
RunPreFilter(__FILE__);
if (empty($pflag)) {
ShowFormSpider();
}
elseif ($pflag == 'send') {
ProcessFormSpider();
}
RunPostFilter(__FILE__);
i need the form to post the vars $looking & $spelling. but if i include as such:
Code:
@mail($email_to, $name, $body, $looking, $spelling "From: $from \nX-Mailer: INDEXU_X-Mailer/1.0");
V5.3