Trouble with PHP formmail

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi, I'm using PHP 4.4.4 and have downloaded the free script
formmail.php (version 4.1b).  Wondered if anyone had experienced the
same problem I'm having.  I'm submitting a form to formmail.php, but
none of the variables seem to be getting recognized.  Here is part of
the form I'm submitting ...

<body onload="document.forms[0].submit();">
Sending Order ...

<form action="formmail.php" method=post
      <INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
      <INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.html">
      <INPUT TYPE="hidden" NAME="recipient"

but then I get warnings like below ...

Notice: Undefined variable: recipient in
/usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 365

Notice: Undefined variable: required in
/usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 383

Notice: Undefined variable: require in
/usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 388

Notice: Undefined variable: email in
/usr/local/apache2/htdocs/andersonscoffee/formmail.php on line 429

but as you can see above, "recipient" and "email" are clearly defined.
What am I doing wrong?

Thanks, - Dave

Re: Trouble with PHP formmail wrote:
Quoted text here. Click to load it

The script you've downloaded likely requires register_globals to be
enabled (bad) and your server has it disabled (good).  Either turn it
on in php.ini (bad) or get a newer version of the script that doesn't
require it (good).  If there isn't a version of formmail.php that
doesn't require register globals then I'd look for another script.

Re: Trouble with PHP formmail

Quoted text here. Click to load it

I'd look for another script in any case. That one is the kind of that  
spammers exploit to deliver their junkmail to people. Recipient in a hidden  
field, come on!! It will become a spam relay faster than you can say  
supercalifragilisticexpialidocious...  >:(

"Ohjelmoija  on  organismi  joka  muuttaa  kofeiinia  koodiksi" - lpk - Satunnaisesti pivittyv nettisarjis | rot13(xvzzb@bhgbyrzcv.arg)  

Re: Trouble with PHP formmail

Those are just Notices about undefined variables, if you don't want to
go over the script and you don't want to see them just change your
error reporting level to E_ALL & ~E_NOTICE  in your PHP.ini file (or
just for the script in question).
Personally I'd try to fix the variables in question but that is up to
the individual developer as they are not critical errors or faults.

Re: Trouble with PHP formmail

On 6 Nov 2006 08:06:32 -0800, ""

Quoted text here. Click to load it

 They're not clearly defined at all. They're in your form, but that doesn't
mean there will be a $recipient variable.

 The script should be looking in $_POST['recipient'], etc., and if it's not,
then it's assuming the deprecated and potentially dangerous "register_globals"
option is on (search the manual or Google for more info), and so the script is
very old and hasn't been updated for the past several years of changes in PHP.

Andy Hassall :: :: :: disk and FTP usage analysis tool

Site Timeline