I am posting this for a friend of mine, i wrote a small script for her to process her form data to an email but in testing i am having trouble getting the checkbox data to display in the email it sends. if you select multiple checkboxes it emails only the last checked box.
the following is the html code:
Code: <td><p>Job Description:</p></td>
<td><label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Drywall" id="jobdescription_0" />
Drywall</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Insulation" id="jobdescription_1" />
Insulation</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Taping" id="jobdescription_2" />
Taping</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Texture" id="jobdescription_3" />
Texture</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Stucco" id="jobdescription_4" />
Stucco</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="T-Bar" id="jobdescription_5" />
T-Bar</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Custom Ceilings" id="jobdescription_6" />
Custom Ceilings</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Steel Stud Framing" id="jobdescription_7" />
Steel Stud Framing</div>
<div align="left"></div>
<label> </label>
<div align="left">
<input type="checkbox" name="job_description[]" value="Bulk Heads" id="jobdescription_8" />
Bulk Heads</div>
and this is the php code:
Code: <?php
date_default_timezone_set('America/Edmonton');
$yourEmail = "test@yahoo.ca";
//The Email Address Form Results Will Be Sent To. Change to your email.
$subject = "Online Job Requests";
//This will be displayed in your Email Subject line. Edit as needed.
$body = "Name: $_REQUEST $name n Email Address: $_REQUEST $email n Phone: $_REQUEST $phone n Job Type: $_REQUEST $job_type n Job Description: $_REQUEST $job_description n";
$timestamp = date("n/j/Y, a\t g:i a T");
$thankyousubject = "Request Submitted Successfully n on n $timestamp";
//This will be displayed after a submission. Edit to suit your needs. The n represent page breaks.
$thankyoumsg = "Thank you $_REQUEST[name] we have recieved your information. We will contact you soon.";
//This will be displayed after a submission. Edit to suit your needs.
$job_description ="";
foreach($_REQUEST["job_description"] as $value) {
$job_description .= "$valuen";
}
?>
<?php
mail($yourEmail, $subject, $body, "From: $_REQUEST[$name] < $_REQUEST[$email] >");
print "<CENTER><B><body bgcolor='#2c2c2c'><font color='#FFFFFF'> $thankyousubject </B></CENTER>
<center>$thankyoumsg</center><BR><BR><CENTER>
</font><A HREF="http://www.shekinteriors.com" TARGET="_top"><IMG SRC="http://www.shekinteriors.com/formbanner.gif" WIDTH="600" HEIGHT="100" ALT="Return to Shek Interiors Ltd" BORDER="0"></A></CENTER></body>"
?>
i thought the
Code: $job_description ="";
foreach($_REQUEST["job_description"] as $value) {
$job_description .= "$valuen";
}
would help this but the mail it generates looks like the following:
Code: Name: Array test525
Email Address: Array dtyjdtj@ftdhdxf.com
Phone: Array 67586785
Job Type: Array New Commercial
Job Description: Array Bulk Heads
could someone please help me figure this out. i'm not super familiar with php and it's driving me bonkers
RFQ Configuration - can you make PLANT field an optional field in ME42
Is there a way to make the plant field on an RFQ optional in change mode (ME42)?
Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO principles. I've started reading OOP tutorials including the design patterns. And John is right, this
Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,
Problems with adding a link to one position in a 'foreach' loop, please help
Hello!Iam pretty new to programming and I wanna create a table with users from an array. It works just fine but in one table row I wanna add a link to it so I can click on the username to edit it
Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages. The form is submitted using the POST method. Here is a code snippet:Code: <form action =
trouble printing an array....
I'm having some trouble printing out an array forwards. I'm figuring out the high and low of an array and did soo, but can't print out. My result is zero. if anyone could help that would be great, and
Upload file and add HTML
Hey everyone,I have a client has meeting agendas and minutes that should be posted online. I could teach someone how to FTP it onto the site, but I thought PHP would allow for a cooler solution. Here
Is it possible to view php source code??
Hi AllI was just wondering if it's possible to view a websites php source code? I know that php is a server side scripting language and that it is processed at the server and the results are sent
Will an XHTML DOCTYPE interfere with my PHP if I'm not experienced enough?
I've read this article here: http://friendlybit.com/html/why-xhtml-is-a-bad-idea/In a nutshell it says XHTML is a big no-no for non-geeks when it comes to dynamic pages i.e. PHP.Do I sidestep XHTML
problem with php mysql query
Hi guy's...I'm totally lost here..because don't have any idea how to make a query for grab record using BETWEEN startdate and enddate since existing record are stored using this format