Formhandler problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smordue
Forum Newbie
Posts: 7
Joined: Mon Dec 07, 2009 1:07 pm

Formhandler problem

Post by smordue »

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?

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); }
?>
 
I think my using a php script within a script is my problem.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Formhandler problem

Post by AbraCadaver »

Yeah, you can't do that. Why not just:

Code: Select all

$lines = file('basedata.txt');
$mailto = $lines[9];
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply