Help Me! Plz? Multidimensional Arrays to Email
Posted: Sun Feb 17, 2008 11:21 am
Ok i have written the php to email everything on my html form execpt this so i will show you what i have and then if anyone could be so kind as to show me the correct way of doing this, keep in mind that i have only been doing php for 1 month and learned from the php5 and mysql bible.
that is the sample of the normal html fields im using, which im not having problems with but what im having problems with is
I cant seem to get them to work right, i have 51 checkboxes (50 states and washington dc) i have my php form handler set up to email me the info from these forms and it looks like this
at this moments it will only send one state and not all that r chosen so....
im in a tight spot, i dont know what i should do at this point, i looked up multidimensional arrays but im not sure how to incorporate them into my current form handler so i could use a hand here.
i know this is probable a noob thing but like i said i just started using php a month ago and learned it from a book so plz go easy on me and i would appreciate and help without any flaming.
thanks in advance
Innervate
Code: Select all
<form action="Sell_agency.php" method="post" name="SellAgency" onSubmit="return validator(this)">
<table width="929" height="244">
<TR>
<TD width="86" height="40" ALIGN="right"><label for="Contact_FullName">Contact Name:</label></TD>
<TD width="276"><INPUT NAME="Contact_FullName" type="text" SIZE=45> </TD>
</TR>
<TR>
<TD height="24" ALIGN="right"><EM>Title</EM></TD>
<TD><Input NAME="Contact_Title" type="text" SIZE=35> </TD>
</TR>
<TR>
<TD height="24" ALIGN="right"><EM>Organization</EM></TD>
<TD><INPUT NAME="Contact_Organization" type="text" SIZE=45> </TD>Code: Select all
<input type="Checkbox" name="boxes[1]" value="Alabama"/>
<span class="style3"> ALABAMA<br>
<input type="Checkbox" name="boxes[2]" value="Alaska"/>
ALASKA <br>
<input type="Checkbox" name="boxes[3]" value="Arizona"/>
ARIZONA <br>Code: Select all
<?php
$Contact_FullName = $_POST['Contact_FullName'];
$Contact_Title = $_POST['Contact_Title'];
$Contact_Organization = $_POST['Contact_Organization'];
$Contact_WorkPhone = $_POST['Contact_WorkPhone'];
$Contact_FAX = $_POST['Contact_FAX'];
$Contact_Email = $_POST['Contact_Email'];
$Contact_URL = $_POST['Contact_URL'];
$additional_info = $_POST['additional_info'];
$bail_volume = $_POST['bail_volume'];
$boxes = $_POST['boxes'];
$formsent = mail('info@somerandomsite.com',
'Somerandomsite Sell Agency',
"Request From:
Name: $Contact_FullName\r\n
Title: $Contact_Title\r\n
Organization: $Contact_Organization\r\n
WorkPhone: $Contact_WorkPhone\r\n
FAX: $Contact_FAX\r\n
Email: $Contact_Email\r\n
URL: $Contact_URL\r\n
Additional Info: $additional_info\r\n
Bail Volume: $bail_volume\r\n
States: $boxes\r\n",
"From: $Contact_Email\r\n Bounce-to: info@somerandomsite.com");
if ($formsent) {
echo "<P>Hi, $Contact_FullName, We have received your request, we will respond to you as soon as possible.
Thank You,
somerandomsite.com";
} else {
echo "I'm sorry $Contact_FullName, but there seems to be a problem, please try to resubmitt the form.";
}
?>im in a tight spot, i dont know what i should do at this point, i looked up multidimensional arrays but im not sure how to incorporate them into my current form handler so i could use a hand here.
i know this is probable a noob thing but like i said i just started using php a month ago and learned it from a book so plz go easy on me and i would appreciate and help without any flaming.
thanks in advance
Innervate