Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 35

Thread: mailform without confirmation

  1. #21
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    When does that appear when nothing is selected?
    When any are selected?

  2. #22
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    Please try it yourself here
    Send as many mails as you like

  3. #23
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Looks like it's working to me just remove the echos. Are you not getting emails?

    DONT REMOVE ALL ECHOS. If you dont know which to remove please ask.

  4. #24
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    I received your 2 test emails so far.

    May I ask you which echo's to remove, please ?
    Walrus, I have NO IDEA of php !

    Please note that now the mail is sent without selecting an option !

  5. #25
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    No, sorry, the mail gets not send, but the message on the site says it has !

  6. #26
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Can you post your full php code? I'll remove the echos you don't need and look for the unknown !. I'll post back in about 1/2 hour gotta run right now.

  7. #27
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    This is the php so far:

    Code:
    <?php
    echo "TO IS EQUAL TO: " . $_POST['to'] . "<br />";
    if ($_POST["action"] == "send"){
    if ($_POST[name] != " your name" and $_POST[name] != "" and $_POST[email] != " your e-mail adress" and $_POST[email] != "" and $_POST[message] != "") { 
    if ($_POST['to'] === "1") { 
    echo "TO IS 1<br />";
    $mail_to = "info@cego.com";
    }
    if ($_POST['to'] === "2") { 
    echo "TO IS 2<br />";
    $mail_to = "admin@hrdeel.be";
    }
    if ($_POST['to'] === "3") { 
    echo "TO IS 3<br />";
    $mail_to = "bro@post.be";
    }
    echo "Was to set?<br />";
    
    mail ($mail_to, "via NET", "
    Name: ".$_POST['name']."
    E-mail: ".$_POST['email']."
    Message: ".$_POST['message']."
    ",
    "From: ".$_POST['name']." <".$_POST['email'].">");
    echo '<br>&nbsp;<br>Thanks ! <br>&nbsp;<br>Your message has been sent.<br>&nbsp;<br>&nbsp;<br> NET will get back to you within two working days.<br>&nbsp;<br>&nbsp;<br>';
    }
    else{
    echo '<br>&nbsp;<br><font color="#565656;">Your mail has NOT been sent !</font><br>&nbsp;<br>Please fill in all data.<br>Your name, email adress and message are mandatory fields.<br>&nbsp;<br>&nbsp;<br><a href="about.php"><font color="#565656;">[again please]</font></a><br>&nbsp;<br>';
    }
    }
    ?>
    And this is the form:

    Code:
    <select name="to" style="width:170px; margin-top:26px;">
    <option selected value="0">what is your message about</option>
    <option value="1">safaris in africa</option>
    <option value="2">places for rent in BsAs</option>
    <option value="3">ski in Argentina</option>
    </select>
    Regarding the not sending of message when not selected an option, but showing the 'message sent': could it have to do with the selected value="0" ?

  8. #28
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Not sure try just value though, I think the default value is the first value so you should be all set there anyway.
    PHP Code:
    <?php
    if ($_POST["action"] == "send"){
    if (
    $_POST['name'] != " your name" and $_POST['name'] != "" and $_POST['email'] != " your e-mail adress" and $_POST['email'] != "" and $_POST['message'] != "" and $_POST[to] != "" and $_POST['to'] != "0") { 
    if (
    $_POST['to'] === "1") { 
    $mail_to "info@cego.com";
    }
    if (
    $_POST['to'] === "2") { 
    $mail_to "admin@hrdeel.be";
    }
    if (
    $_POST['to'] === "3") { 
    $mail_to "bro@post.be";
    }
    mail ($mail_to"via NET""
    Name: "
    .$_POST['name']."
    E-mail: "
    .$_POST['email']."
    Message: "
    .$_POST['message']."
    "
    ,
    "From: ".$_POST['name']." <".$_POST['email'].">");
    echo 
    '<br>&nbsp;<br>Thanks ! <br>&nbsp;<br>Your message has been sent.<br>&nbsp;<br>&nbsp;<br> NET will get back to you within two working days.<br>&nbsp;<br>&nbsp;<br>';
    }
    else{
    echo 
    '<br>&nbsp;<br><font color="#565656;">Your mail has NOT been sent !</font><br>&nbsp;<br>Please fill in all data.<br>Your name, email adress and message are mandatory fields.<br>&nbsp;<br>&nbsp;<br><a href="about.php"><font color="#565656;">[again please]</font></a><br>&nbsp;<br>';
    }
    }
    ?>

  9. #29
    Join Date
    Jul 2006
    Location
    Antwerp, Belgium (Europe)
    Posts
    927
    Thanks
    121
    Thanked 2 Times in 2 Posts

    Default

    All works well, except that, when not selecting an option, the mail does not get sent, but the message that the mail has been sent, appears. How come ?

  10. #30
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I'm going to run 4 tests.

    Test one nothing be entered returned this.



    Your mail has NOT been sent !

    Please fill in all data.
    Your name, email adress and message are mandatory fields.


    [again please]
    Test two

    Thanks !

    Your message has been sent.


    NET will get back to you within two working days.
    Test three

    Thanks !

    Your message has been sent.


    NET will get back to you within two working days.
    test four

    Thanks !

    Your message has been sent.


    NET will get back to you within two working days.
    If this is working you should have 3 emails with subject email and message all being the same, but different per email address. If you do not let me know which you did not get.

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
  •