Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: PHP Survey Form

  1. #1

    PHP Survey Form

    Hi, I am needing help with a Survey form to email me when answers are submitted. I am havign a hard time getting any PHP to work correctly. Could someone point me in the right direction?

    Here is my form:
    HTML Code:
    <form method="POST" action="mailer.php" >
              <label>
              <strong>What class are you in?</strong>
              <input name="Class2" type="text" id="Class2" maxlength="4" />
              <br />
              <br />
              <strong>How many times have you had contact with the Financial Aid Office within the past 12 months?</strong></label>
              </br>
            <label> <br />
            <input type="radio" name="times" value="0-2" /> 
            0-2</label>
              <br />
                <label>
                  <input type="radio" name="times" value="3-5" />
                  3-5</label>
                <br />
                <label>
                  <input type="radio" name="times" value="5-10" />
                  5-10</label>
                <br />
                <label>
                  <input type="radio" name="times" value="Over 10" />
                  Over 10 </label>
                <p><strong>Was this contact (check all that apply)</strong></p>
                
    <label>
                  <input name="contact" type="checkbox" value="In person" />
                  In person</label>
              <br />
                    <label>
                  <input name="contact" type="checkbox" value="By phone" />
                  By phone</label>
              <br />
                    <label>
                  <input name="contact" type="checkbox" value="By email" />
                  By email</label>
              <br />
                    <label>
                  <input name="contact" type="checkbox" value="Fax" />
                  Fax</label>
              <br />
                    <label>
                  <input name="contact" type="checkbox" value="No contact with the Financial Aid Office" />
                  No contact with the Financial Aid Office</label>
              <br />
                    <label>
                  <input name="contact" type="checkbox" value="Other" />
                  Other</label>
              <p><strong>What was the nature of your visit(s)? (check all the apply)</strong></strong><br />
                <label>
                  <input name="nature" type="checkbox" value="Loan question/assistance" />
                  Loan question/assistance</label>
                  <br />
                  <label>
                  <input name="nature" type="checkbox" value="Scholarship question/assistance" />
                  Scholarship question/assistance</label>
                  <br />
                  <label>
                  <input name="nature" type="checkbox" value="Application/FAFSA assistance" />
                  Application/FAFSA assistance</label>
                  <br />
                  <label>
                  <input name="nature" type="checkbox" value="Debt load counseling" />
                  Debt load counseling</label>
                  <br />
                  <label>
                  <input name="nature" type="checkbox" value="HPSP question/counseling" />
                  HPSP question/counseling</label>
                  <br />
                  <label>
                  <input name="nature" type="checkbox" value="Special Circumstances Appeal" />
                  Special Circumstances Appeal</label>
                  <br />
                  <label>
                  <input name="nature" type="checkbox" value="No contact with the Financial Aid Office2" />
                  No contact with the Financial Aid Office</label>
              </p>
              <p><strong>Were you treated courteously and professionally?</strong><br />
                <label>
    <input type="radio" name="treated" value="Strongly agree" />
    Strongly agree</label>
                <br />
                <label>
                <input type="radio" name="treated" value="Agree" />
    Agree</label>
                <br />
                <label>
                <input type="radio" name="treated" value="No opinion/no contact with the Financial Aid Office" />
    No opinion/no contact with the Financial Aid Office</label>
                <br />
                <label>
                <input type="radio" name="treated" value="Disagree" />
    Disagree</label>
                <br />
                <label>
                <input type="radio" name="treated" value="Strongly disagree" />
    Strongly disagree</label>
                <br />
                <br />
                <label></label>
                <strong>Were your questions/concerns adequately addressed?</strong><br />
                  <label>
                  <input type="radio" name="addressed" value="Strongly agree" />
    Strongly agree</label>
                  <br />
                  <label>
                  <input type="radio" name="addressed" value="Agree" />
    Agree</label>
                  <br />
                  <label>
                  <input type="radio" name="addressed" value="No contact with the Financial Aid Office" />
    No contact with the Financial Aid Office</label>
                  <br />
                  <label>
                  <input type="radio" name="addressed" value="Disagree" />
    Disagree</label>
                  <br />
                  <label>
                  <input type="radio" name="addressed" value="Strongly disagree" />
    Strongly disagree</label>
                  <br />
                <label><br />
                </label>
                <strong>Was the Financial Aid Office staff knowledgeable with accurate and up-to-date information?</strong><br />     
                <label>
                <input type="radio" name="knowledgeable" value="Strongly agree" />
    Strongly agree</label>
                <br />
                <label>
                <input type="radio" name="knowledgeable" value="Agree" />
    Agree</label>
                <br />
                <label>
                <input type="radio" name="knowledgeable" value="No contact with the Financial Aid Office" />
    No contact with the Financial Aid Office</label>
                <br />
                <label>
                <input type="radio" name="knowledgeable" value="Disagree" />
    Disagree</label>
                <br />
                <label>
                <input type="radio" name="knowledgeable" value="Strongly disagree" />
    Strongly disagree</label>
                <br />
                <label></label>
              </p>
              <p>  <strong>Was the Financial Aid Office efficient and timely in getting all required information &amp; forms to you regarding financial aid?</strong><br />
                <label>
                <input type="radio" name="efficient" value="Strongly agree" />
    Strongly agree</label>
                <br />
                <label>
                <input type="radio" name="efficient" value="Agree" />
    Agree</label>
                <br />
                <label>
                <input type="radio" name="efficient" value="No contact with the Financial Aid Office" />
    No contact with the Financial Aid Office</label>
                <br />
                <label>
                <input type="radio" name="efficient" value="Disagree"  />
    Disagree</label>
                <br />
                <label>
                <input type="radio" name="efficient" value="Strongly disagree" />
    Strongly disagree</label>
                <br />
                <label></label>
              </p>
              <p><strong>Was the Financial Aid Office thorough in explaining your financial aid options?</strong><br />
                <label>            
                <input type="radio" name="explaining" value="Strongly agree" />
    Strongly agree</label>
                <br />
                <label>
                <input type="radio" name="explaining" value="Agree" />
    Agree</label>
                <br />
                <label>
                <input type="radio" name="explaining" value="No contact with the Financial Aid Office" />
    No contact with the Financial Aid Office</label>
                <br />
                <label>
                <input type="radio" name="explaining" value="Disagree" />
    Disagree</label>
                <br />
                <label>
                <input type="radio" name="explaining" value="Strongly disagree" />
    Strongly disagree</label>
                <br />
                <label></label>
              </p>
              <p><strong>If you received assistance through the Financial Aid website, was there sufficient information available to answer your questions?</strong><br />
                <label>            
                <input type="radio" name="information" value="Yes"/>
    Yes</label>
                <br />
                <label>
                <input type="radio" name="information" value="No" />
    No</label>
                <br />
                <label>
                <input type="radio" name="information" value="Have not received assistance through website" />
    Have not received assistance through website</label>
                <br />
                <label></label>
              </p>
              <p><strong>How satisfied were you with your overall visit to the Financial Aid website?</strong><br />
                <label>            
                <input type="radio" name="satisfied" value="Very satisfied" />
    Very satisfied</label>
                <br />
                <label>
                <input type="radio" name="satisfied" value="Satisfied" />
    Satisfied</label>
                <br />
                <label>
                <input type="radio" name="satisfied" value="Have not visited the website" />
    Have not visited the website</label>
                <br />
                <label>
                <input type="radio" name="satisfied" value="Dissatisfied" />
    Dissatisfied</label>
                <br />
                <label>
                <input type="radio" name="satisfied" value="Very dissatisfied" />
    Very dissatisfied</label>
                <br />
                <label></label>
              </p>
            <p><strong>Do you feel informed on the availability of financial aid resources?</strong><br />
                  <label>
                  <input type="radio" name="informed" value="Strongly agree" />
    Strongly agree</label>
                  <br />
                  <label>
                  <input type="radio" name="informed" value="Agree" />
    Agree</label>
                  <br />
                  <label>
                  <input type="radio" name="informed" value="No opinion/not interested in financial aid" />
    No opinion/not interested in finanical aid</label>
                  <br />
                  <label>
                  <input type="radio" name="informed" value="Disagree" />
    Disagree</label>
                  <br />
                  <label>
                  <input type="radio" name="informed" value="Strongly disagree" />
    Strongly disagree</label>
               <br />
                <label></label>
            </p>
              <p>
                <label><strong>Please include any comments or suggestions</strong>.<br />
                <textarea name="suggestions" id="Please include any comments or suggestions." cols="45" rows="5"></textarea>
                </label>
              </p>
              <p>
                <label><strong>If you would like us to contact you about any of your responses, please provide your name and email address.
                </strong>
                <textarea name="reply" cols="45" rows="5"></textarea>
                </label>
              </p>
              <p align="right">
                <label>
                <input type="submit" name="Submit" value="Submit" />
                <input type="reset" name="Reset" value="Reset" />
                </label>
                <br /> 
              </p>
            </form>
    Thank you!

  2. #2
    What exactly is the problem you are facing? Do you have a server side script to email you the form submission?

    The following tutorials might help:
    Email Form 'HowTo's

    PHP Form to email explained

  3. #3
    Thanks!! Yes below is the PHP i have to email me the results. When I do a tutorial with only text boxes or just one set of radio buttons it will work right for me but when I try to convert it for the form above, it will either email me a blank email or nothing at all.

    PHP Code:
    <?php 
    if(isset($_POST['submit'])) { 
    $to "kralls@vcom.vt.edu"
    $subject "Financial Aid Survey"
    $class2 $_POST['class2']; 

    foreach(
    $_POST['check'] as $value) { 
    $check_msg .= "Checked: $value\n"
    }
    $option $_POST['radio']; 
    $suggestions$_POST['suggestions'];
    $reply $_POST['reply'];
    $body "Class: $class2\n Suggestions: $suggestions\n Option: $option\n Drop-Down: $dropdown\n Message:\n $message"
      
    echo 
    '' ;
    mail($to$subject$body); 
    } else { 
    echo 
    "Thank you!
    Your information has been submitted."


    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012