form help

Discussion in 'PHP' started by flowster, Sep 9, 2007.

  1. #1
    Hi everyone, I posted last week regarding a problem i had with my form, Ive gone away, and took the time to get my php working as well as i can, only problem now, is when i submit my form, it keeps saying all fields need to be filled in, but everything is filled in, could one of you experts please take a look at my code tell me where im going wrong.

    <?php
    $txtFirstName=$_POST["txtFirstName"];
    $surname=$_POST["surname"];
    $txtAddress1=$_POST["txtAddress1"];
    $txtAddress2=$_POST["txtAddress2"];
    $postcode=$_POST["postcode"];
    $txtCountry=$_POST["txtCountry"];
    $txtTelephone=$_POST["txtTelephone"];
    $txtMobile=$_POST["txtMobile"];
    $txtEmail=$_POST["txtEmail"];
    $txtproduct=$_POST["txtproduct"];
    $brochure=$_POST["brochure"];
    $radContactby=$_POST["radContactby"];
    If ((!$txtFirstName) || (!$surname) || (!$txtAddress1) || (!$txtAddress2)
    || (!$postcode) || (!$txtCountry) || (!$txtMobile) || (!$txtEmail)
    || (!$txtproduct) || (!$radContactby) || (!$brochure) || (!$txtTelephone))
    {

    echo("


    <center>Sorry,all the fields must be filled out.</center>");


    }
    else
    {
    $body1 ="Name : ".$txtFirstName." ".$surname." Address : ".$txtAddress1." ".$txtAddress2." Postal code : ".
    $postcode." country : ".$txtCountry." Telephone : ".$txtTelephone." Mobile phone : ".$txtMobile." Email: ".$txtEmail." Chosen product :".
    $txtproduct." ".$brochure." Preffered contact : ".$radContactby;



    $to = "smnfowler@aol.co.uk";
    $subject ="CentreofAttention";
    $body = $body1;
    if (mail($to, $subject, $body))
    {
    echo("

    <center>Thank you!Email sent!</center>");
    }
    else
    {
    echo("


    Message delivery failed...</p>");
    }





    }
    ?>

    your help will be much appreciated

    Flowster

    if you need to see the form it is at www.centreofattentionuk.com
     
    flowster, Sep 9, 2007 IP
  2. abixalmon

    abixalmon Well-Known Member

    Messages:
    378
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Looks like you still have a errors

     
    abixalmon, Sep 9, 2007 IP
  3. flowster

    flowster Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    just trying something, it didnt work... was closer before i think will upload original php file now
     
    flowster, Sep 9, 2007 IP
  4. webrickco

    webrickco Active Member

    Messages:
    268
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    You should put some display to see if some or no values are filled in. If none, you should consider to take a look at the posting script which would be the one responsible for the filling of these variables.
     
    webrickco, Sep 10, 2007 IP
  5. Bishop81

    Bishop81 Peon

    Messages:
    757
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Maybe the input names are mis-typed? I do that all the time.
     
    Bishop81, Sep 10, 2007 IP
  6. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #6
    You should also scan for invalid or spam email headers in your input, like Bcc:, then ban any IPs that try and send them. I had a spam issue on my site from that. Also use a verification image.
     
    Synchronium, Sep 10, 2007 IP