Professional Web Applications Themes

quick help with php/form. checkboxes. - PHP Development

I got great help from here in helping me create an easy php script to send me an email when someone fills out my contactus page. Here is the script, and below is what I want added to it if someone could please help! ---- <? $Name=$_POST['Name']; $Email=$_POST['Email']; $Comments=$_POST['Message']; $to="com"; $message="$Name just filled in your contact form. Message was:\n$Message\n\nTheir E-Mail address was: $Email"; if(mail($to,"Comments From Contact Us",$message,"From: $Email\n")) { header("Location: http://mywebhost.com/success.html"); } else { header("Location: http://mywebhost.com/error.html"); } ?> ---- I'd like to add two more text fields under the Email portion, respectively "phone number" and "where did you hear about ...

  1. #1

    Default quick help with php/form. checkboxes.

    I got great help from here in helping me create an easy php script to
    send me an email when someone fills out my contactus page. Here is the
    script, and below is what I want added to it if someone could please help!

    ----
    <?
    $Name=$_POST['Name'];
    $Email=$_POST['Email'];
    $Comments=$_POST['Message'];
    $to="com";
    $message="$Name just filled in your contact form. Message
    was:\n$Message\n\nTheir E-Mail address was: $Email";
    if(mail($to,"Comments From Contact Us",$message,"From: $Email\n")) {
    header("Location: http://mywebhost.com/success.html");
    } else {
    header("Location: http://mywebhost.com/error.html");
    }
    ?>
    ----

    I'd like to add two more text fields under the Email portion,
    respectively "phone number" and "where did you hear about us". This
    seems easy, but I am confused on the output. Can I just add text to the
    $message line, and add the string $phone and $source (for the two new
    fields)? I have a feeling there is more coding involved then that.

    But more importantly, I'd like to add two checkboxes. Basically, the
    question will be "preffered method of contact?" and the boxes will be
    "email" and/or "phone". Both checkboxes will be in the same line
    horizontally (probably doesn't matter), and the string names will be
    "boxemail" and "boxphone"

    How would I setup the script to also take the information from this, and
    set it up so the output makes sense?

    Thanx in advance!

    --
    Regards from Trypt!
    trypt2000(remove)
    Trypt Guest

  2. #2

    Default Re: quick help with php/form. checkboxes.

    I noticed that Message-ID: <com> from
    Trypt contained the following:
     

    You might like to take a look at the (newly revamped)
    www.ckdog.co.uk/phmail


    --
    Geoff Berrow 0110001001101100010000000110
    001101101011011001000110111101100111001011
    100110001101101111001011100111010101101011
    Geoff Guest

  3. #3

    Default Re: quick help with php/form. checkboxes.

    Geoff Berrow wrote: 
    >
    >
    > You might like to take a look at the (newly revamped)
    > www.ckdog.co.uk/phmail
    >
    >[/ref]

    Thanx Geoff. You have any idea about the checkboxes? I can make the
    text fields and areas just fine, and it sends them, however I can't
    figure out the checkboxes.

    --
    Regards from Trypt!
    trypt2000(remove)
    Trypt Guest

  4. #4

    Default Re: quick help with php/form. checkboxes.

    I noticed that Message-ID: <com> from
    Trypt contained the following:
     

    Checkboxes don't return a value unless checked. Is that your problem?

    --
    Geoff Berrow 0110001001101100010000000110
    001101101011011001000110111101100111001011
    100110001101101111001011100111010101101011
    Geoff Guest

Similar Threads

  1. Form w/checkboxes to update database
    By pblecha in forum Coldfusion Database Access
    Replies: 3
    Last Post: December 6th, 06:56 AM
  2. Flash Form Checkboxes
    By johnnyred in forum Macromedia ColdFusion
    Replies: 4
    Last Post: February 17th, 05:19 PM
  3. Newbie: form checkboxes & param
    By Nadine in forum PERL Miscellaneous
    Replies: 3
    Last Post: September 25th, 11:20 AM
  4. adding checkboxes in a form
    By marc in forum Microsoft Access
    Replies: 0
    Last Post: July 31st, 12:18 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139