Welcome! Log In Create A New Profile

Advanced

feedback form

Posted by collins 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
feedback form
March 26, 2009 09:22AM
Hi, i need help with the form below, I'm not getting any email sent back to me and I keep getting an error message. Please help me fix this.
The html and php are below:

<form id="form1" name="form1" method="post" action="mailer.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="8"><h4>Note: Please ensure all fields with * are filled in!</h4></td>
</tr>
<tr>
<td colspan="8" align="left" valign="top"><label for="textfield"></label>
<table width="102%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="19%" height="22" align="right">* Full name:</td>
<td width="37%"><input name="name" type="text" id="name" size="40" /></td>
<td width="44%" colspan="2" rowspan="8" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="right">* Home Phone:</td>
<td><input name="telephone" type="text" id="Telephone" size="40" /></td>
</tr>
<tr>
<td align="right">* Cell:</td>
<td><input name="cell" type="text" id="Cell" size="40" /></td>
</tr>
<tr>
<td align="right">Fax:</td>
<td><input name="fax" type="text" id="fax" size="40" /></td>
</tr>
<tr>
<td align="right"> * Email: </td>
<td><input name="email" type="text" id="email" size="40" /></td>
</tr>

<tr>
<td align="right">* Retype email address:</td>
<td><input name="emailtwo" type="text" id="emailtwo" size="40" /></td>
</tr>
<tr>
<td align="right">Country:</td>
<td><input name="country" type="text" id="country" size="40" /></td>
</tr>
<tr>
<td align="right">Your City:</td>
<td><input name="city" type="text" id="city" size="40" /></td>
</tr>
</table>

<h4>Booking Details: (Check that all dates are correct)</h4>
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="21%" align="right">Arrival Date:</td>
<td width="79%"><table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%" align="right">Day:</td>
<td width="8%"><label for="select"></label>
<select name="day" id="day">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select> </td>
<td width="30%" align="right">Month:&nbsp;&nbsp;</td>
<td width="18%"><select name="month" id="month">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select></td>
<td width="19%" align="right">Year:</td>
<td width="12%"><select name="year" id="year">
<option value="1">2009</option>
<option value="2">2010</option>
<option value="3">2011</option>
<option value="4">2012</option>
<option value="5">2013</option>
<option value="6">2014</option>
<option value="7">2015</option>
<option value="8">2016</option>
<option value="9">2017</option>
<option value="10">2018</option>
<option value="11">2019</option>
<option value="12">2020</option>
</select></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right">Departure:</td>
<td><table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13%" align="right">Day:</td>
<td width="8%"><label for="select"></label>
<select name="select" id="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select> </td>
<td width="30%" align="right">Month:&nbsp;&nbsp;</td>
<td width="18%"><select name="select" id="select2">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select></td>
<td width="19%" align="right">Year:</td>
<td width="12%"><select name="select" id="select3">
<option value="1">2009</option>
<option value="2">2010</option>
<option value="3">2011</option>
<option value="4">2012</option>
<option value="5">2013</option>
<option value="6">2014</option>
<option value="7">2015</option>
<option value="8">2016</option>
<option value="9">2017</option>
<option value="10">2018</option>
<option value="11">2019</option>
<option value="12">2020</option>
</select></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="26%" align="right">Number of Adults: </td>
<td width="15%"><input name="adults" type="text" id="adults" size="2" maxlength="2" /></td>
<td width="12%" rowspan="3" align="right" valign="top">Special Request or Comments: </td>
<td width="47%" rowspan="3" valign="top"><textarea name="comments" id="comments" rows="4"></textarea></td>
</tr>
<tr>
<td align="right">Number of Children:</td>
<td><input name="children" type="text" id="children" size="2" maxlength="2" /></td>
</tr>
<tr>
<td height="22" align="right">Number of Bedrooms: </td>
<td><input name="bedrooms" type="text" id="bedrooms" size="2" maxlength="2" /></td>
</tr>

<tr>
<td height="26">&nbsp;</td>
<td><input type="submit" name="submit" value="Submit Form" id="Submit" /></td>
<td align="right">&nbsp;</td>
<td><input type="reset" name="Reset" value="Reset Form" id="reset" /></td>
</tr>
</table></td>
</tr>

<tr>
<td height="19" colspan="8" align="left">&nbsp;&nbsp;
<label for="textfield"></label>
<label for="textarea"></label>
<label for="Submit"></label> <label for="label"></label></td>
</tr>
</table>
</form>

the PHP code that i'm using is:

<?php
if(isset($_POST['submit'])) {


$to = "collinsnyamadzawo@gmail.com";
$subject = "Online Booking";
$name_field = $_POST['name'];
$telephone_field = $_POST['telephone'];
$cell_field = $_POST['cell'];
$fax_field = $_POST['fax'];
$email_field = $_POST['email'];
$emailtwo_field = $_POST['emailtwo'];
$country_field = $_POST['country'];
$city_field = $_POST['city'];
$arrivalday_dropdown = $_POST['arrivalday'];
$arrivalmonth_dropdown = $_POST['arrivalday'];
$arrivalyear_dropdown = $_POST['arrivalyear'];
$departureday_dropdown = $_POST['departureday'];
$departuremonth_dropdown = $_POST['departuremonth'];
$departureyear_dropdown = $_POST['departureyear'];
$adults_field = $_POST['adults'];
$children_field = $_POST['children'];
$children_field = $_POST['children'];
$bedrooms = $_POST['bedrooms'];
$comments = $_POST['comments'];

foreach($_POST['dropdown'] as $value) {

$dropdown_msg .= "selection: $value\n";

}

$body = "From: $name_field\n E-Mail: $email_field\n Drop-Down: $dropdown\n Message:\n $comments\n";

echo "Your form has been submitted thank you";
mail($to, $subject, $body);


} else {

echo "There was problem submitting your page please check that all fields are filled in!";

}
?>
avatar
Mac
Re: feedback form
March 26, 2009 11:17AM
Are you doing this course?
This forum is for students doing the php course only.
You will find enough info on this issue by Googling....
Re: feedback form
March 26, 2009 11:38AM
I'm doing Internet and Web design and am designing a page where I want to put in these fields. I have a shallow knowledge of Php and intend studying it when I'm done with Internet and Web design.
Re: feedback form
March 26, 2009 12:54PM
I'm doing Internet and Web design and am designing a page where I want to put in these fields. I have a shallow knowledge of Php and intend studying it when I'm done with Internet and Web design.
Re: feedback form
March 26, 2009 03:48PM
what is your error msg, and have u set up your php.ini file with the proper smtp settings?

Also I did the Internet and web design course and you dont need to use any php in that course. I think you biting off more than you can chew. You just need to stick to using things that the course deals with instead of making things hard for yourself.

If you really want to use PHP, google for tutorials on what you trying to do.
Sorry, only registered users may post in this forum.

Click here to login