[thelist] PHP Form Help

Ralph Guzman ralph213 at sbcglobal.net
Tue Mar 30 12:09:55 CST 2004


Get rid of - in your variables, and if you must use long variable names use
something more conventional like

$bestTime

$howDidYouFindUs 

$numberBedrooms

$finishedBasement

Etc...

Also, get into the habit of writing your code using register globals off:

http://us3.php.net/register_globals

so if you have a form with the following fields:

<INPUT TYPE="text" NAME="email">
<INPUT TYPE="text" NAME="bestTime">

Then in your php logic
 
$msg .= "Email:   $_POST['email']\n";
$msg .= "BestTime: $_POST['bestTime']\n";

Good luck!



-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Jeff Hinds
Sent: Sunday, March 28, 2004 8:40 PM
To: thelist at lists.evolt.org
Subject: [thelist] PHP Form Help

I've created and used small PHP forms and now am attempting a 
large inquiry form and it's not sending all the results.

I believe I have part of the form code wrong.

The form does not send email results for anything past
$msg .= "BestTime:		$BestTime\n";
except for comments.

I would appreciate any help you could give.

Thanks,

Jeff

Here's the php code:

<?

$msg = "E-mail from Mini Maid Contact Form \n";
$msg .= "From:
$name\n";
$msg .= "Email:
$email\n";
$msg .= "Address:
$Address\n";
$msg .= "City:
$City\n";
$msg .= "state:
$state\n";
$msg .= "zipcode:
$zipcode\n";
$msg .= "HomePhone:
$HomePhone\n";
$msg .= "WorkPhone:
$WorkPhone\n";
$msg .= "Email:
$Email\n";
$msg .= "BestTime:
$BestTime\n";
$msg .= "How-did-you-find-us:
$How-did-you-find-us\n";
$msg .= "Number-Bedrooms:
$Number-Bedrooms\n";
$msg .= "Number-Bathrooms:
$Number-Bathrooms\n";
$msg .= "Finished-Basement:
$Finished-Basement\n";
$msg .= "Square-Foot:
$Square-Foot\n";
$msg .= "Number-in-home:
$People-in-home\n";
$msg .= "Number-in-home:
$Number-in-home\n";
$msg .= "How-often-cleaned:
$How-often-cleaned\n";
$msg .= "Comments:
$Comments\n\n";

$to = "jeff.hinds at netagency.com";
$subject = "Mini Maid Feedback";
$mailheaders = "From: Mini Maid Web Site <> \n";
$mailheaders .= "Reply-To: $email\n\n";

mail($to, $subject, $msg, $mailheaders);

?>


<HTML>
<HEAD>
<TITLE> Mini Maid Feedback Form Sent </TITLE>
</HEAD>

<BODY>

<H1>Thank you <? echo "$name"; ?>, your email has been sent.</H1>


<P> <B>Your E-mail Address:</B><BR>
<? echo "email"; ?>

<P> <B>Message:</B><BR>
<? echo "$message"; ?>

</BODY>
</HTML>

-- 
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 




More information about the thelist mailing list