Formhandler problem
Posted: Mon Dec 07, 2009 1:10 pm
I am using a formhandler script for my contact page that is supposed to grab the mailto address from line 9 of a flatfile, but it isn't working, any help?
I think my using a php script within a script is my problem.
Code: Select all
<?php
$email = $POST[email];
$mailto = <?
$lines = file('basedata.txt');
$l_count = count($lines);
for($x = 0; $x< $l_count; $x++)
{
}
echo "" . $lines[9] . "" ;
?>;
$mailsubj = "Website Contact Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site contact form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
?>