Hi Guys,
I am very new to PHP, and am learning slowly. I have created a survey form which I want to have emailed to me. But I don't have a clue as to how to get the info from the form included in the email. When i click the submit button I get an email, but it is completely blank.
This is the form:
HTML Code:
<p class="style1"> </p>
<form action="sendmail.php" method="post" name="customersurvey" class="style1" id="customersurvey">
<p>Overall how satisfied were you with the quality of service received from our company?</p>
<p>
<label>
<input type="radio" name="Questiona" value="excellent" />
Excellent</label>
<br />
<label>
<input type="radio" name="Questiona" value="verygood" />
Very Good</label>
<br />
<label>
<input type="radio" name="Questiona" value="good" />
Good</label>
<br />
<label>
<input type="radio" name="Questiona" value="fair" />
Fair</label>
<br />
<label>
<input type="radio" name="Questiona" value="poor" />
Poor</label>
<br />
<label>
<input type="radio" name="Questiona" value="verypoor" />
Very Poor</label>
<br />
</p>
<p>How did you rate the quality and speed of communications from Our company?</p>
<p>
<label>
<input type="radio" name="Questionb" value="excellent" />
Excellent</label>
<br />
<label>
<input type="radio" name="Questionb" value="verygood" />
Very Good</label>
<br />
<label>
<input type="radio" name="Questionb" value="good" />
Good</label>
<br />
<label>
<input type="radio" name="Questionb" value="fair" />
Fair</label>
<br />
<label>
<input type="radio" name="Questionb" value="poor" />
Poor</label>
<br />
<label>
<input type="radio" name="Questionb" value="verypoor" />
Very Poor</label>
<br />
</p>
<p>In relation to your service requirements, did we Meet:</p>
<p>
<label>
<input type="radio" name="RadioGroupa" value="allrequirements" />
All Requirements</label>
<br />
<label>
<input type="radio" name="RadioGroupa" value="nearlyallreq" />
Nearly All Requirements</label>
<br />
<label>
<input type="radio" name="RadioGroupa" value="somereq" />
Some of the Requirements</label>
<br />
<label>
<input type="radio" name="RadioGroupa" value="veryfew" />
Very Few Requirements</label>
<br />
<label>
<input type="radio" name="RadioGroupa" value="norequirements" />
None of the Requirements</label>
<br />
</p>
<p>Were your dealings with us dealt with:</p>
<p>
<label>
<input type="radio" name="RadioGroupb" value="verypro" />
Very Professionally</label>
<br />
<label>
<input type="radio" name="RadioGroupb" value="professional" />
Professionally</label>
<br />
<label>
<input type="radio" name="RadioGroupb" value="adequately" />
Adequately</label>
<br />
<label>
<input type="radio" name="RadioGroupb" value="unprofessional" />
Un-professionally</label>
<br />
</p>
<p>Did you feel that anything was missing from the service you received?</p>
<p>
<label>
<input type="radio" name="RadioGroupc" value="yes" />
Yes</label>
<br />
<label>
<input type="radio" name="RadioGroupc" value="no" />
No</label>
<br />
</p>
<p>If Yes or you have any other comments please complete text box below</p>
<p>
<textarea name="textfield" cols="70" rows="4"></textarea>
</p>
<p>Please Enter your Name and Password below before submitting </p>
<p>
<label>Customer Name
<input name="textfield2" type="text" maxlength="70" />
</label>
<label>Password
<input type="password" name="textfield3" />
</label>
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
<p class="style1"> </p>
Apart from the mailing line and the header line, I think I have screwed up the sendmail.php script (which is on a seperate page). thats as follows, but don't laugh. I'm trying.....
PHP Code:
<?php $Questiona = $_POST['Questiona'] ; $Questionb = $_POST['Questionb'] ; $Radiogroupa = $_POST['Radiogroupa'] ; $Radiogroupb = $_POST['Radiogroupb'] ; $Radiogroupc = $_POST['Radiogroupc'] ; $textfield = $_POST['textfield'] ; $textfield3 = $_POST['textfield3'] ; mail( "[EMAIL="shonah@shonah.fslife.co.uk"]shonah@shonah.fslife.co.uk[/EMAIL]", "Feedback Form Results", $message, "From: $textfield2" ); header( "Location: [URL]http://www.ourcompany.com/thankyou.php[/URL]" ); ?>
I don't even get the details from textfield2??????
Can anyone help please?
Last edited by chrishirst; 02-26-2010 at 11:51 AM..
|