473,224 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Trouble with PHP formmail

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
enctype="application/x-www-form-urlencoded">
<INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
<INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.html">
<INPUT TYPE="hidden" NAME="recipient"
VALUE="la***********@gmail.com">
....
</form>
</body>
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

Nov 6 '06 #1
4 2990

la***********@zipmail.com wrote:
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
enctype="application/x-www-form-urlencoded">
<INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
<INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.html">
<INPUT TYPE="hidden" NAME="recipient"
VALUE="la***********@gmail.com">
...
</form>
</body>
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
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.

Nov 6 '06 #2
On 6 Nov 2006 08:06:32 -0800, "la***********@zipmail.com"
<la***********@zipmail.comwrote:
>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
enctype="application/x-www-form-urlencoded">
<INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
<INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.html">
<INPUT TYPE="hidden" NAME="recipient"
VALUE="la***********@gmail.com">
...
</form>
</body>
but then I get warnings like below ...

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

but as you can see above, "recipient" and "email" are clearly defined.
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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 6 '06 #3
"ZeldorBlat" <ze********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>
la***********@zipmail.com wrote:
>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
enctype="application/x-www-form-urlencoded">
<INPUT TYPE="hidden" NAME="subject" VALUE="Order for Coffee">
<INPUT TYPE="hidden" NAME="redirect" VALUE="thanks.html">
<INPUT TYPE="hidden" NAME="recipient"
VALUE="la***********@gmail.com">
...
</form>
</body>

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.
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
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi.net | rot13(xv***@bhgbyrzcv.arg)
Nov 7 '06 #4
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.

Nov 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mcp6453 | last post by:
I am trying to use Jack's FormMail script (http://www.dtheatre.com/scripts/formmail). Since I'm brand new at PHP and not very good at HTML, I have an easy question, which I will narrow down. When...
1
by: Kurt | last post by:
Hello, I have software that allows direct submission of tech support requests. The software connect directly to a formmail script. The problem is that if the user types a '=' or a '&' anywhere...
0
by: Craig | last post by:
I keep getting the error "Error: Bad/No Recipient" when submitting a form using formmail.pl Here is the part of the formmail.pl that you are supposed to alter to suit your needs using fake url...
4
by: Hmmm... | last post by:
I am setting up a web site for a friend. Her hosting service does not support Sendmail. It is an NT server. They recommend I use Smtp. I have been using something like formmail.pl when I have...
5
by: John Oliver | last post by:
I'd like the email produced by FormMail to show a specific From: address rather than postmaster@server.host.name Googling isn't helping me... not sure what to look for :-( -- * John Oliver ...
0
by: Aidan | last post by:
Hi PHP guru's, I've been working on creating a PHP formmail script. I have a working version, but I'd like to get feed back on what security holes I may have opened, and what I could do better....
2
by: Rico | last post by:
Hello, I'm using formmail.asp which is an emailing utility. Basically, the user fills out a request page, clicks "Submit" and the page posts to formmail.asp which emails the user information. ...
3
by: Geoff Cox | last post by:
Hello, I am using the formmail.cgi script and wonder if it is possible to have the user enter their email address and then have the results sent to this address by formmail.cgi? If yes, how...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.