SecurityAssist - Email Password - MySQL Error
I'm getting a MySQL error when users try to use the "Email Password" page on a site I set-up using the SecurityAssist wizard to retrieve their unencrypted password from the database. The other pages (login, logout, profile) seem to work fine. I would greatly appreciate any specific suggestions on how to adjust the code or the database.
The error message that appears in the browser after a user enters an email address (matching one in the database) and hits send:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@myemailaddresshere.com' at line 1"
Below is the relevant code (with generic replacements for site-specific identifiers). The site is hosted on bluehost.com (Linux, MySQL 5.0, PHP 5.2).
Thanks in advance,
J.
<?php require_once('../Connections/connSAMPLE1.php');?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
function WA_SecurityAssist_Email_1_SendMail($WA_Auth_Parameter){
$WA_MailObject = WA_SecurityAssist_Definition("mail.testcase.org","25","SAMPLE@testcase.org@ymail.testcase.org","","","");
$WA_MailObject = WA_SecurityAssist_SendMail($WA_MailObject,"","","",$WA_Auth_Parameter["toAddress"],"",$WA_Auth_Parameter["fromAddress"],$WA_Auth_Parameter["subject"],$WA_Auth_Parameter["mailBody"]);
$WA_MailObject = null;
}// WA_SecurityAssist_Email_1_SendMail
?>
<?php
if(isset($_POST["Send_x"])){
//WA SecurityAssist Email object="Mail for Linux"
$WA_Auth_Parameter = array(
"connection" => $connSAMPLE1,
"database" => $database_connSAMPLE1,
"tableName" => "Equipment",
"filterColumn" => "Email_Address",
"columnValue" => "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."",
"columnType" => "",
"usernameColumn" => "Member_ID",
"passwordColumn" => "userP",
"selectColumns" => array(""),
"sessionVariables" => array(""),
"successRedirect" => "SAMPLE_LogIn.php",
"failRedirect" => "SAMPLE_EmailPW.php",
"keepQueryString" => TRUE,
"toAddressColumn" => "Email_Address",
"fromAddress" => "SAMPLE@testcase.org",
"fromAddressDisplay" => "SAMPLE Association ",
"subject" => "SAMPLE Password Request",
"mailBody" => "User name: [Member_ID]\nPassword: [userP]",
"emailFunction" => "WA_SecurityAssist_Email_1_SendMail"
);
WA_Auth_ForgotPassword($WA_Auth_Parameter);
}
?>
AND HERE IS THE EMAIL PASSWORD REQUEST FORM:
<div id="ForgotPWContainer" class="WAATK">
<form action="SAMPLE_EmailPW.php" method="post" name="WAATKForgotPWForm" id="WAATKForgotPWForm">
<h1> </h1>
<table class="WAATKDataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th>Email:</th>
<td><input type="text" name="emailAddress" /></td>
</tr>
</table>
<div class="WAATKButtonRow">
<p>
<input type="image" hspace="0" vspace="0" border="0" name="Send" id="Send" value="Send" alt="Send" src="../WA_SecurityAssist/images/Slate/Refined_send.gif" />