Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
EMAIL Radio Button forms
Old 02-24-2010, 08:34 PM EMAIL Radio Button forms
Novice Talker

Posts: 5
Name: Shona Holmes
Trades: 0
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">&nbsp;</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">&nbsp;</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..
shrek64 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-26-2010, 10:34 AM Re: EMAIL Radio Button forms
prasanthmj's Avatar
Experienced Talker

Posts: 42
Name: Prasanth
Trades: 0
I don't see the $message being initialized.

Add a line to compose $message like this, before mail()
example:
PHP Code:
$message "Questiona: $Questiona\n textfield: $textfield"
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
prasanthmj is offline
Reply With Quote
View Public Profile
 
Old 02-26-2010, 05:15 PM Re: EMAIL Radio Button forms
Novice Talker

Posts: 5
Name: Shona Holmes
Trades: 0
Thanks for that, I now have the text box fields, but I am not getting the values for each question. Will I need to put some if/else code in the html page? or is there something I can put in the php page?
I thought the script looked too simple to be true.
shrek64 is offline
Reply With Quote
View Public Profile
 
Old 03-01-2010, 05:44 PM Re: EMAIL Radio Button forms
Novice Talker

Posts: 5
Name: Shona Holmes
Trades: 0
After a little bit of fiddling I got this to work perfeclty thank you very much. However there is maybe another question you could help me with.
At present I have a password field which will accept anything and the form will submit, what I want to do is to issue a set password to my customers that they will need to enter in the password field, but if they get it wrong they will get an error message and need to re-submit.
I assume it willbe a simple if / else code, but I am not sure where to put it, to make it work. is it on the HTML form page or my sendmail.php
shrek64 is offline
Reply With Quote
View Public Profile
 
Old 09-02-2010, 06:35 AM Re: EMAIL Radio Button forms
Junior Talker

Posts: 2
Name: Alan
Trades: 0
Quote:
Originally Posted by shrek64 View Post
After a little bit of fiddling I got this to work perfeclty thank you very much. However there is maybe another question you could help me with.
At present I have a password field which will accept anything and the form will submit, what I want to do is to issue a set password to my customers that they will need to enter in the password field, but if they get it wrong they will get an error message and need to re-submit.
I assume it willbe a simple if / else code, but I am not sure where to put it, to make it work. is it on the HTML form page or my sendmail.php
Hi, i face the same problem..My problem is i totally receive any email after i click on my submit button. I need to get the information of my radio button, can i know how you did it? Please and thanks!
Endlesz is offline
Reply With Quote
View Public Profile
 
Old 09-04-2010, 08:33 AM Re: EMAIL Radio Button forms
Novice Talker

Posts: 12
Name: chris
Trades: 0
Quote:
Originally Posted by shrek64 View Post
After a little bit of fiddling I got this to work perfeclty thank you very much. However there is maybe another question you could help me with.
At present I have a password field which will accept anything and the form will submit, what I want to do is to issue a set password to my customers that they will need to enter in the password field, but if they get it wrong they will get an error message and need to re-submit.
I assume it willbe a simple if / else code, but I am not sure where to put it, to make it work. is it on the HTML form page or my sendmail.php
edit to this

at top of the form page add:
PHP Code:
$password ""//fill with your password 
Around your email sending block
if($_POST['paswordinputname'] == $password){

Your email sending scripting here

}else{

echo "password incorrect email not sent";

}

basically what your doing is checking that the password matches your given password. You could actually display the password with some text on the page so that its just a spam capture and ppl can still use it to email you

EG:

echo "in order to submit this email there is a password set please enter the word $password into the email form in the correct place";
cdjhosting is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to EMAIL Radio Button forms
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24259 seconds with 12 queries