Hi, I'm trying to use the following script to send mail to any address given in the previous form.
But, it only works with a static e-mail address on the mailto: line. What's wrong with it? Why won't the following work?
<font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#ffffff"><?
$i=0;
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
echo "<b>$key</b> = $val<br>";
}
function reimport_any_vars($arrayname) {
$mailto= "$email"; <== WHAT'S WRONG??
$subject= "Feedback";
$from= "The Panthers' Cage";
global $$arrayname;
if (!is_array($$arrayname))
return;
reset($$arrayname);
while(list($key, $val) = each($$arrayname)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
$line[$i]= "$key = $val
";
$message= "$message$line[$i]";
$i++;
}
$footer= "
Questions? Problems?
E-mail: mitya@themoon.co.uk
Or call: (555) 555-5555";
$message= "$message$footer";
mail( "$mailto", "$subject", "$message", "From: $from");
}
reimport_any_vars( "HTTP_POST_VARS");
?></font>
Thanks in advance, urgent help needed!