[thelist] PHP form problems

Tom Dell'Aringa pixelmech at gmail.com
Tue Apr 24 12:34:13 CDT 2007


On 4/20/07, Mark Groen <evolt at markgroen.com> wrote:

>
> On Friday 20 April 2007 11:06, Tom Dell'Aringa wrote:
> > .........
> > <describes problem with PHP forms> ...tried to good looking canned form
> scripts
> > which are simple to implement, but neither one seems to send any info or
> > work correctly.
>
> As mentioned, see if you get a phpinfo.php results first so you know PHP
> is
> working. Then, check if there is a sendmail path, search for "Path to
> sendmail /usr/sbin/sendmail -t -i".


Yep, I had run phpinfo.php and php is correctly working and the Path to
sendmail is exactly as you show it to be. I should mention that with my very
basic form (not the ones I tried afterward) the form does post and process -
but none of the form fields come over in the e-mail. (see below)

If that's good, use your own error reporting rather than relying on the
> server
> settings, copy the script linked below and include it first at the first
> file
> that's loaded in your application.
>
> Example 566. Using error handling in a script:
> http://ca3.php.net/manual/en/ref.errorfunc.php#e-strict


I've tried using this script in 3 different versions of the form - each time
I get a blank page or blank everything after the script.

Maybe we step back a moment and see what I am doing in my very basic form
handling script, which is hardly anything at all:

code:
===========================
//mail contact info from form

$name = $_POST["name"];
$email = $_POST["email"];
$comments = $_POST["comments"];

$message = "From: $name\n\nSender: $email\n\nComment: $comments";

mail("pixelmech at domain.com", "OraTechNet Form Feedback", $message, "From:
$email\r\nReply-To: $email\r\n");

Header("Location:http://www.domain.com/thank-you.php");
============================

That's all there is to it. Like I said earlier, on my dev domain, I get all
the info in my e-mail immediately, but on my clients domain, the email does
come over - but it's totally blank. It's as if it has no idea that the
variables contain any data I assume.

My client's server is running PHP 4.0.6, my dev server is running 4.4.4 ...

Thanks for the help so far.

Tom



More information about the thelist mailing list