E-form help

the mail() function

Moderators: macek, egami, gesf

ari
New php-forum User
New php-forum User
Posts: 1
Joined: Tue May 10, 2011 12:38 pm

E-form help

Postby ari » Tue May 10, 2011 12:44 pm

I have an Eform script that seems to be having a specific issue. The last question of the form requests the user to select as many "health issue" as they want. However when I receive the eform back, it only shows 1 issue as opposed to all that were selected:

html form:
<form enctype='multipart/form-data' action='process.php' method='post'>

<font face="Verdana" size="2">Name</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Name'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Email</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Email'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Daytime phone</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Daytimephone'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Evening phone</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Eveningphone'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">City</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='City'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">County</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='County'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">State</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='State'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Ethnic background</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Ethnicbackground'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Age</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Age'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Occupation</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Occupation'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Spouse occupation</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Spouseoccupation'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Highest level of school completed</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><select name='Highestlevelofschoolcompleted'><option value='Select'>Select<option value='Less than high school'>Less than high school<option value='High school/ GED'>High school/ GED<option value='Vocational/ Tech'>Vocational/ Tech<option value='Some college'>Some college<option value='Associate degree'>Associate degree<option value='Bachelor degree'>Bachelor degree<option value='Post graduate'>Post graduate</select></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Marital status</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><select name='Maritalstatus'><option value='Select'>Select<option value='Single'>Single<option value='Married/ partnered'>Married/ partnered<option value='Divorced'>Divorced<option value='Widowed'>Widowed</select></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Ages of kids at home</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Agesofkidsathome'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Ages of kids away</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><input type=text name='Agesofkidsaway'></td></tr><tr><td height="30" width="55" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<img border="0" src="bc_new.gif" width="28" height="28"></td><td height="30" width="189" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana" size="2">Health issues</td>
<td height="30" width="469" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
<font face="Verdana"><select name='Healthissues' size="10" multiple="multiple"><option value='Select' selected="selected">Select<option value='Asthma'>Asthma<option value='Depression'>Depression<option value='Heart disease'>Heart disease<option value='High blood pressure'>High blood pressure<option value='High cholesterol'>High cholesterol<option value='Type I / Type II Diabetes'>Type I / Type II Diabetes<option value='Osteoarthritis'>Osteoarthritis<option value='Rheumatoid Arthritis'>Rheumatoid Arthritis<option value='Cancer'>Cancer<option value='Crohns Disease'>Crohns Disease<option value='Multiple Sclerosis'>Multiple Sclerosis<option value='Parkinsons'>Parkinsons<option value='Alzheimers'>Alzheimers<option value='Psoriasis'>Psoriasis<option value='Anxiety'>Anxiety<option value=' Obsessive Compulsive Disorder'> Obsessive Compulsive Disorder<option value='Other'>Other<option value='None of the above'>None of the above
</select></td></tr><tr><td colspan="3" bgcolor="#B5CBEF" height="25" width="737" background="tile_sub.gif"><p align="center"><font face="Verdana" size="2"><input type=submit value='Submit Form'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type=reset value='Reset Form'></font></td></tr>
</table></form>
<div align="center"><span class="style2"><span class="style7">Eisen Research contact information: (617) 848-4211<br />
Email: <a href="mailto:info@eisenresearch.com">info@eisenresearch.com</a></span><br />
&copy; 2010 Eisen Research.</span><br>
<br>
</div>


php:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Email');
pt_register('POST','Daytimephone');
pt_register('POST','Eveningphone');
pt_register('POST','City');
pt_register('POST','County');
pt_register('POST','State');
pt_register('POST','Ethnicbackground');
pt_register('POST','Age');
pt_register('POST','Occupation');
pt_register('POST','Spouseoccupation');
pt_register('POST','Highestlevelofschoolcompleted');
pt_register('POST','Maritalstatus');
pt_register('POST','Agesofkidsathome');
pt_register('POST','Agesofkidsaway');
pt_register('POST','Healthissues');
if( is_array($Healthissues)){
while (list ($key, $val) = each ($Healthissues)) {
echo "$val <br>";
}
}//else{echo "not array";}
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$Email)){
$error.="<li>Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Email: ".$Email."
Daytime phone: ".$Daytimephone."
Evening phone: ".$Eveningphone."
City: ".$City."
County: ".$County."
State: ".$State."
Ethnic background: ".$Ethnicbackground."
Age: ".$Age."
Occupation: ".$Occupation."
Spouse occupation: ".$Spouseoccupation."
Highest level of school completed: ".$Highestlevelofschoolcompleted."
Marital status: ".$Maritalstatus."
Ages of kids at home: ".$Agesofkidsathome."
Ages of kids away: ".$Agesofkidsaway."
Health issues: ".$Healthissues."
";
$message = stripslashes($message);
mail("info@eisenresearch.com","Database Submission from website",$message,"From: phpFormGenerator");

header("Refresh: 0;url=http://www.eisenresearch.com/thankyou.html");
?><?php
}
?>

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron