+ Reply to Thread
Results 1 to 4 of 4

Thread: PHP help

  1. #1
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    PHP help

    Ive made a questionnair and everything works the way i want it besides the order of the information that get sends to my email.

    MY PHP CODE:
    <?php


    function is_valid_email($from_email)
    {
    return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>]+\.+[a-z]{2,6}))$#si', $from_email);
    }



    $to_email = "blabla@hotmail.com";
    $subject = "Questionnaire";
    $myradiobutton1.=$_POST['myradiobutton1']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton2']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton3']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton4']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton5']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton6']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton7']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton8']."\n" ;



    $message = "

    1. Do you welcome international students in Melbourne:
    $myradiobutton1

    2. Do you think international students deserve better consideration in terms of eligibility for concession on public transport?
    $myradiobutton2

    3. Do you believe enough safety measures are provided to international students on public transport?
    $myradiobutton3

    4. Do you think international students should be treated the same way as local students?
    $myradiobutton4

    5. Are you aware that the cost of travelling on public transport for international students is very high?
    $myradiobutton5

    6. Do you think Victoria is a safe destination for international students?
    $myradiobutton6

    7. Do you believe it is wise to open up Victoria’s education system to international students without considering the qualitative aspects?
    $myradiobutton7

    8. Do you think the government is doing enough to support international students in Victoria?
    $myradiobutton8

    ";


    $sent = mail($to_email, $subject, $message) ;
    if($sent)
    {print "Your mail was sent successfully."; }

    else
    {print "We encountered an error sending your mail"; }

    ?>


    The Current Result:
    This is what gets sent to my email. I want the answers to be below each question...


    1. Do you welcome international students in Melbourne:
    No
    Yes
    Yes
    No
    Yes
    Yes
    Yes
    Yes


    2. Do you think international students deserve better consideration in terms of eligibility for concession on public transport?


    3. Do you believe enough safety measures are provided to international students on public transport?

  2. #2
    TechAsh's Avatar
    TechAsh is offline Retired TechAsh is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    5,853

    Re: PHP help

    Try changing this:
    PHP Code:
    $myradiobutton1.=$_POST['myradiobutton1']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton2']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton3']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton4']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton5']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton6']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton7']."\n" ;
    $myradiobutton1.=$_POST['myradiobutton8']."\n" 
    To this:
    PHP Code:
    $myradiobutton1.=$_POST['myradiobutton1']."\n" ;
    $myradiobutton2.=$_POST['myradiobutton2']."\n" ;
    $myradiobutton3.=$_POST['myradiobutton3']."\n" ;
    $myradiobutton4.=$_POST['myradiobutton4']."\n" ;
    $myradiobutton5.=$_POST['myradiobutton5']."\n" ;
    $myradiobutton6.=$_POST['myradiobutton6']."\n" ;
    $myradiobutton7.=$_POST['myradiobutton7']."\n" ;
    $myradiobutton8.=$_POST['myradiobutton8']."\n" 
    Useful Links:
    Terms of Service | Server News | Buy a Domain
    Free Domains: co.cc | Dot.tk -- Free File Storage: Dropbox -- Website Monitoring: Service Uptime


    My Websites:
    Earthtime Games & TechAsh's Blog

  3. #3
    focus is offline x10 Sophmore focus is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    112

    Re: PHP help

    What a silly mistake.... Thank you =]

  4. #4
    TechAsh's Avatar
    TechAsh is offline Retired TechAsh is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    5,853

    Re: PHP help

    No Problem. I do that sort of stuff all the time :-P
    Useful Links:
    Terms of Service | Server News | Buy a Domain
    Free Domains: co.cc | Dot.tk -- Free File Storage: Dropbox -- Website Monitoring: Service Uptime


    My Websites:
    Earthtime Games & TechAsh's Blog

+ Reply to Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. php errors galore
    By DMG Online in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 05-17-2008, 06:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers