PHP question

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jamesb2

Thread Starter
Joined
Dec 8, 2007
Messages
129
I am creating a form in expression web 4. Everything appears to be working correctly when I click submit on the form. All of the fields are filled out and the php script I have does send it to an email address. My question is the following; when I fill out all of the fields in the form, not all of the fields show up. It appears I can only get past 2 fields being filled out before it starts sending blank forms. see the code below.

$msg =$_POST['WSD-Name'];
$msg2=$_POST['WSD-Phone'];
$msg3=$_POST['WSD-Email'];
$msg4=$_POST['WSD-Address'];
$msg5=$_POST['WSD-City'];
$msg6=$_POST['WSD-ZIP'];
$msg7=$_POST['WSD-DOB'];
$msg8=$_POST['WSD-Fitness-Level'];
$to='[email protected];
$subject='Wsd application';

mail($to,$subject,$msg8,$msg7,$msg6,$msg5,$msg4,$msg3,$msg2,$msg);
 

Ent

Josiah
Retired Trusted Advisor
Joined
Apr 11, 2009
Messages
5,467
I'm surprised it's doing anything at all.
Mail doesn't take an arbitrary number of parameters. It takes between 3 and 5.
What you probably want to do is create a single string variable with all the chunks of the message concatenated together, and then call mail($to, $subject, $wholeMessage);


Aside, but important.
Do not use this script on a live website. The reason is that you should never trust the input that your user gives you. Instead you should run validation code to make sure that it is the kind of information you expected for that field, and be extra careful if you want to allow arbitrary text. Otherwise they can do nasty things like breaking databases or sending spam from your website.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top