Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Checkboxes include in Mailto

    Hey, im new to php.
    Basically I have made a form to request which type of job(s) are needed, which when filled will then be sent to an email address.

    The problem im having is that when more than 1 checkbox is ticked, the mailto only sends 1 of the checkedboxes.

    My script for the checkboxes are:::::::
    <span class="label"><span class="labelred">*</span>Job type:</span>
    <label>
    <input type="checkbox" name="job" value="paper" id="job_0" />
    Paper Hanging</label>
    <br />
    <div style="margin-left:270px";><label>
    <input type="checkbox" name="job" value="painting" id="job_1" />
    Painting</label>
    <br />
    <label>
    <input type="checkbox" name="job" value="insurance" id="job_2" />
    Insurance Work</label>
    </div>

    --------------------------------------------------------------
    My mailto script for this section is basically:
    $_job = $_REQUEST['job']..

    How do i request an individual job ID? or make the name of the checkboxes 'job' to include all th checked items in to the main body of the email?
    Just so you know, in the body of the email, i simply have the $job variable added into it.

    Any help would be greatful, it cant be that hard, but i have no idea!

    Cheers!!

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    I believe the problem will more than likely be with your mail server. most hosting providers will not allow spam mail to be delivered from there servers which the foot prints you make applying the above method would lead your host to believe. Create a loop, go through the loop processing 1 at a time and use sleep(13). 13seconds should be enough delay to be passed as "human".
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for replying to this, but I am very new,
    I've used loops once but i wouldnt know how to add this into the php, and sleep is something i've never heard of at all.

    It is only the checkboxes that only sends just 1 checked item, everything else sends through fine.

    Could you expand on that at all?

  • #4
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    post your html for your page (right click, view source)
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #5
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is the php script once the forms been submitted

    <?php
    $title =$_REQUEST['title'];
    $first = $_REQUEST['first'];
    $surname = $_REQUEST['surname'];
    $email = $_REQUEST['email'];
    $phone = $_REQUEST['phone'];
    $mphone = $_REQUEST['mphone'];
    $reply = $_REQUEST['reply'];
    $time = $_REQUEST['time'];
    $job = $_REQUEST['job'];
    $comment = $_REQUEST['comment'];

    $website = "www.swindonpainters.co.uk";

    $to = "EMAILEMAILEMAIL ;
    $subject = "Request Estimate form: $email";
    $body = "The following information has been filled in.

    -----------------------------------
    Title: $title,
    First name: $first,
    Surname: $surname,
    -----------------------------------
    E-mail: $email,
    Phone: $phone,
    Mobile: $mphone,
    Reply Method: $reply,
    Reply Time: $time,
    -----------------------------------
    Job Type: $job,
    Comment: $comment
    -----------------------------------";
    $headers = "From: $to";

    $headers2 = "From: $to";
    $subject2 = "Thank you for Requesting an Estimate";
    $autoreply = "Thank you Requesting an Estimate.
    Somebody will get back to you as soon as possible, usualy within 48 hours.
    Regards, $website";


    if($title == '') {print "You have not entered a Title, please go back and try again";}
    else{
    if($first == '') {print "You have not entered a First name, please go back and try again";}
    else{
    if($surname == '') {print "You have not entered your Surname, please go back and try again";}
    else{
    if($email == '') {print "You have not entered your Email address, please go back and try again";}
    else{
    if($phone == '') {print "You have not entered your Phone Number, please go back and try again";}
    else{
    if($reply == '') {print "You have not entered a Method to Reply, please go back and try again";}
    else{
    if($job == '') {print "You have not entered a Job Type, please go back and try again";}
    else{
    if($comment == '') {print "You have not entered a Comment or Question, please go back and try again";}
    else {
    $send = mail($to, $subject, $body);
    $send2 = mail($email, $subject2, $autoreply);
    if($send) {header ("Location: landrequest.php" );}
    else
    {print "We encountered an error sending your mail, please notify webmaster@bensbox.x10hosting.com"; }
    }
    }
    }
    }
    }
    }
    }
    }
    ?>



    if you want the form page..
    www.bensbox.x10hosting.com/AJs/request.php

  • #6
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #7
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Phil Jackson View Post
    my apolagise, ive since changed it
    http://bensbox.x10hosting.com/AJs/request_est.php

  • #8
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,547
    Thanks
    57
    Thanked 148 Times in 147 Posts
    name="job" on you check boxes should be name="job[]"

    and try:

    PHP Code:
    <?php 
    $title 
    =$_POST['title'];
    $first $_POST['first'];
    $surname $_POST['surname'];
    $email $_POST['email'];
    $phone $_POST['phone'];
    $mphone $_POST['mphone'];
    $reply $_POST['reply'];
    $time $_POST['time'];
    $job $_POST['job'];
    $comment $_POST['comment'];

    $website "www.swindonpainters.co.uk";

    $to "EMAILEMAILEMAIL" ;
    $subject "Request Estimate form: $email";
    $body "
    The following information has been filled in. 
    -----------------------------------
    Title: $title,
    First name: $first, 
    Surname: $surname, 
    -----------------------------------
    E-mail: $email, 
    Phone: $phone,
    Mobile: $mphone,
    Reply Method: $reply, 
    Reply Time: $time,
    -----------------------------------
    Job Type: "
    .implode(", "$job).",
    Comment: $comment
    -----------------------------------
    "
    ;
    $headers "From: $to";

    $headers2 "From: $to"
    $subject2 "Thank you for Requesting an Estimate"
    $autoreply "Thank you Requesting an Estimate. 
    Somebody will get back to you as soon as possible, usualy within 48 hours. 
    Regards, $website"
    ;


    if(
    $title == '') {
        print 
    "You have not entered a Title, please go back and try again";} 
    else{
    if(
    $first == '') {print "You have not entered a First name, please go back and try again";} 
    else{
    if(
    $surname == '') {print "You have not entered your Surname, please go back and try again";} 
    else{
    if(
    $email == '') {print "You have not entered your Email address, please go back and try again";} 
    else{
    if(
    $phone == '') {print "You have not entered your Phone Number, please go back and try again";} 
    else{
    if(
    $reply == '') {print "You have not entered a Method to Reply, please go back and try again";} 
    else{
    if(
    $job == '') {print "You have not entered a Job Type, please go back and try again";} 
    else{
    if(
    $comment == '') {print "You have not entered a Comment or Question, please go back and try again";} 
    else {
    $send mail($to$subject$body); 
    $send2 mail($email$subject2$autoreply); 
    if(
    $send) {header ("Location: landrequest.php" );}
    else 
    {print 
    "We encountered an error sending your mail, please notify webmaster@bensbox.x10hosting.com"; } 
    }
    }
    }
    }
    }
    }
    }
    }
    ?>
    $job should be an array. if(is_array($job)){ echo "yup hes right"; } and using implode should print as string.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 


  •  

    Tags for this Thread

    Posting Permissions

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