php for sending info not working

Discussion in 'PHP' started by bluebirdjc, Nov 26, 2007.

  1. #1
    Hery guys i have made a questionairre in html which i am trying to send the information from that to my email address but its not working

    here is the htm l code


    <HTML>

    <HEAD>
    <title>Questionairre for group project</title>
    </HEAD>

    <BODY>

    <B>Questionnaire for Year 2 Project</B> <BR><BR>Here is a link to the graphic services at Cardiff university
    <br><br>
    Our group wishes to collect information on how the university graphics services website is percieved, and how it could be improved on
    <br><BR>
    <a href="
    http://www.cardiff.ac.uk/insrv/graphicsandmedia/graphicservices/index.html">Graphics services website</h1></a>
    <form method="POST" action="proccessform3.php">

    Course studying <INPUT type="radio" value="4" name="course"> Bsc Computer Science
    <INPUT type="radio" value="3" name="course"> BSC Information Systems
    <INPUT type="radio" value="2" name="course"> Msc
    <INPUT type="radio" value="1" name="course"> Prefer not to say

    <br><br> what do you think about the Cardiff universitys graphic services website?

    <BR><BR>

    <input type="radio" value="4" name="2ndq">Excellent <input type="radio" value="3" name="2ndq">Good <input type="radio" value="2" name="2ndq">Average <input type="radio" value="1" name="2ndq">Poor

    <BR><BR>
    Please give any comments you may have on Cardiff Universitys website <font color ="red"> Optional! </font>

    <input type="text" name="firstname">

    <br><br>If used any what do you currently
    think of the graphics services at Cardiff University? <BR><BR>
    <input type="radio" value="6" name="3rdq">Excellent <input type="radio" value="5" name="3rdq">Good <input
    type="radio" value="4" name="3rdq">Average <input type="radio" value="3" name="3rdq">Poor

    <br><br>Have you used any of the services below provided by
    Cardiff University?

    <BR><BR><table height="70", width="1129">
    <tr>
    <td><INPUT type="checkbox" value="17" name="Mailing-List">Photocopying
    <INPUT type="checkbox" value="16" name="Mailing-List"> Large Format Full Colour Photocopying
    <INPUT type="checkbox" value="15" name="Mailing-List"> Large Format Full Colour Scanning
    <INPUT type="checkbox" value="14" name="Mailing-List"> Large Format Full Colour printing
    <INPUT type="checkbox" value="13" name=Mailing-List> Colour Printing
    <INPUT type="checkbox" value="11" name="Mailing-List"> Cd Writing
    </td></tr><tr><td><INPUT type="checkbox" value="12" name="Mailing-List"> Scanning
    <INPUT type="checkbox" value="10" name="Mailing-List"> Bought a Zip Drive
    <INPUT type="checkbox" value="9" name=Mailing-List> Fax service
    <INPUT type="checkbox" value="8" name="Mailing-List"> Bought Stationery
    <INPUT type="checkbox" value="7" name="Mailing-List"> Laminating
    <INPUT type="checkbox" value="6" name="Mailing-List"> 35mm slide production
    <INPUT type="checkbox" value="5" name="Mailing-List"> T-shirt Printing
    <INPUT type="checkbox" value="4" name="Mailing-List"> Mouse Mat Printing
    <INPUT type="checkbox" value="3" name="Mailing-List"> Sunscreen Printing
    </td></tr><tr><td><INPUT type="checkbox" value="2" name="Mailing-List"> Bindery
    <INPUT type="checkbox" value="1" name=Mailing-List> Any other Print Services </td>
    </td></tr>
    </table>

    <bR>Which of the following would you like to see added to the graphics services website
    <BR><BR><INPUT type="checkbox" value="3" name="which"> Online Ordering
    <INPUT type="checkbox" value="2" name="which"> Order Tracking
    <INPUT type="checkbox" value="1" name="which"> Online Customisation of Orders


    <BR><BR>Do you think a new web system for the graphics services allowing online orders would be useful <BR><BR><INPUT type="radio" value="2" name="5thq">Yes
    <INPUT type="radio" value="1" name="5thq">No

    <BR><BR>Would you like a system which
    shows you images of the graphics services of Cardiff university offer?
    <BR><BR><INPUT type="radio" value="2" name="6thq">Yes <INPUT type="radio" value="1"
    name="6thq">No

    <BR><BR>Would you prefer a system which allows you to track the
    state of your orders? <BR><BR><INPUT type="radio" value="2" name="7thq">Yes <INPUT
    type="radio" value="1" name="7thq">No

    <BR><BR>If you also with to add any more
    comments please do so. However we appreciate that you are busy with other work
    that may need to be completed soon or have to do other things but any help you
    can give whatsoever is much appreciated <BR><TEXTAREA name="extra" rows="5" cols="30"></TEXTAREA><BR><BR><INPUT type="submit" value="send questionaire" name=submit>
    </FORM>Kind regards <BR><BR>Group 1 for CMO240 </P></BODY></HTML>

    and here is the errors i get for it


    Notice: Undefined index: course in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 11

    Notice: Undefined index: 2ndq in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 12

    Notice: Undefined index: 3rdq in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 13

    Notice: Undefined index: Mailing-List in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 15

    Notice: Undefined index: 5thq in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 16

    Notice: Undefined index: which in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 17

    Notice: Undefined index: 6thq in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 18

    Notice: Undefined index: 7thq in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 19

    Notice: Undefined variable: message in /nfs/mntI4/projectsite/J.K.Childs/proccessform3.php on line 24
    Thank you for filling out this questionairre!

    below is my php anyone understand fro that why i get these errors

    <html>
    <head>
    <title>Results of questionairre</title>
    </head>

    <body>
    <?php
    if(isset($_POST['submit'])) {
    $to = "J.K.Childs@cs.cardiff.ac.uk";
    $subject = "Questionairre subbmision";
    $ctaken_field = $_POST['course'];
    $second_question = $_POST['2ndq'];
    $third_question = $_POST['3rdq'];
    $Name_field = $_POST['firstname'];
    $mail_question = $_POST['Mailing-List'];
    $fifth_question = $_POST['5thq'];
    $wh_question = $_POST['which'];
    $sixth_question = $_POST['6thq'];
    $seventh_question = $_POST['7thq'];
    $extra_field = $_POST['extra'];



    $body = "From: $subject\n Course: $ctaken_field\n Answer 2: $second_question\n Answer 3: $third_question\n Answer 4: $Name_field\n Answer 5: $mail_question\n Answer 6: $fifth_question\n Answer 7: $wh_question\n Answer 8: $sixth_question\n Answer 9: $seventh_question\n Answer 10 : $extra_field\n Message:\n $message";

    echo "Thank you for filling out this questionairre!";
    mail($to, $subject, $body);
    } else {
    echo "Sorry there was an error please go back and try again!";
    }
    ?>


    </form>
    </body>

    </html>
     
    bluebirdjc, Nov 26, 2007 IP
  2. lfhost

    lfhost Peon

    Messages:
    232
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I take it you are on a windows server ? OS is always useful.
    You cant use numericals at the start of a variable i.e. 2ndq change to secq

    you also have not defined $message
     
    lfhost, Nov 26, 2007 IP
  3. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #3
    They all are notices not errors.

    Open php.ini & change the error_reporting to not display notices.

    Peace,
     
    Barti1987, Nov 26, 2007 IP
  4. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #4
    or put error_reporting(0) at the very top of your script file
     
    serialCoder, Nov 26, 2007 IP