How do i sort this?

Discussion in 'PHP' started by sindimatrix, Jul 29, 2009.

  1. #1
    I am trying to get this form to work but at fusionoutside (dot)co(dot)uk/contact us I am experinced with html but not php


    Below is a script which is not forwarding an email
    <?php

    $Name = $_POST['Name'];
    $Lastnname = $_POST['Lastname'];
    $Title = $_POST['Title'];
    $Email = $_POST['Email'];
    $Phone = $_POST['Phone'];
    $Email = $_POST['Email'];
    $Enquiry = $_POST['Enquiry'];



    die ("Thank you for contacting us we will contact you soon!! "); {
    if(!$Email == "" && (!strstr($Email,"@") || !strstr($Email,".")))
    {
    echo "<h2>Use Back - Enter valid e-mail</h2>\n";
    $badinput = "<h2>Feedback was NOT submitted</h2>\n";
    echo $badinput;
    die ("Go back! ! ");
    }

    if(empty($Name) || empty($Email)) {
    echo "<h2>Use Back - fill in all fields</h2>\n";
    die ("Use back! ! ");
    }

    $todayis = date("l, F j, Y, g:i a") ;



    $notes = stripcslashes($notes);


    $message = " $todayis [EST] \n
    Name: $Name \n
    Last name: $Lastname \n
    Email: $Email \n
    Phone Number: $Phone \n
    Email: $Email \n
    Enquiry: $Enquiry \n



    ";

    $from = "From: ";



    mail("info@fusionoutside.co.uk", $subject, $message, $from);

    ?>


    I know the characters (name,last name are not matching) but it was just me changing things around trying to find a solution to no success

    YOUR INPUT WILL BE GREATLY APPRECIATED
     
    sindimatrix, Jul 29, 2009 IP
  2. sindimatrix

    sindimatrix Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    I am using dreamweaver 8 by the way
     
    sindimatrix, Jul 29, 2009 IP
  3. Leron

    Leron Active Member

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #3
    Are you testing it on a site or offline? Are you receiving any error message in your browser?
     
    Leron, Jul 29, 2009 IP
  4. sindimatrix

    sindimatrix Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    I am doing everything ONLINE I am getting everything on a browser in fact here is a changed code :


    <?php

    $Name = $_POST['Name'];
    $Lastnname = $_POST['Lastname'];
    $Company = $_POST['Company'];
    $Title = $_POST['Title'];
    $Email = $_POST['Email'];
    $Telephone = $_POST['Telephone'];
    $Mobile = $_POST['Mobile'];
    $Event = $_POST['Event'];
    $Enquiry = $_POST['Enquiry'];



    die ("Thank you for contacting us we will contact you soon!! "); {
    if(!$Email == "" && (!strstr($Email,"@") || !strstr($Email,".")))
    {
    echo "<h2>Use Back - Enter valid e-mail</h2>\n";
    $badinput = "<h2>Feedback was NOT submitted</h2>\n";
    echo $badinput;
    die ("Go back! ! ");
    }

    if(empty($Name) || empty($Email)) {
    echo "<h2>Use Back - fill in all fields</h2>\n";
    die ("Use back! ! ");
    }

    $todayis = date("l, F j, Y, g:i a") ;



    $notes = stripcslashes($notes);


    $message = " $todayis [EST] \n
    Name: $Name \n
    Last name: $Lastname \n
    Company: $Company \n
    Title: $Title\n
    Email: $Email \n
    Telephone: $Telephone \n
    Mobile: $Mobile \n
    Enquiry: $Enquiry \n

    ";

    $from = "From: ";



    mail("info@fusionoutside.co.uk",$subject, $message, $from);

    ?>

    and here is the ERROR MESSAGE


    Parse error: syntax error, unexpected $end in \\NAS37ENT\domains\f\fusionoutside.co.uk\user\htdocs\form_process.php on line 56
     
    sindimatrix, Jul 29, 2009 IP
  5. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #5
    die ("Thank you for contacting us we will contact you soon!! "); {

    remove the {
     
    shallowink, Jul 29, 2009 IP
  6. Leron

    Leron Active Member

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #6
    comment out that line completely.
    
    /*die ("Thank you for contacting us we will contact you soon!! "); {*/
    
    PHP:
    change this:
    
    mail("info@fusionoutside.co.uk",$subject, $message, $from);
    
    PHP:
    To:
    
    if(mail("info@fusionoutside.co.uk",$subject, $message, $from)){
     print "Thank you for contacting us we will contact you soon!!"
    }else{
    // print some error message here
    }
    PHP:
    Hope that helps
     
    Leron, Jul 29, 2009 IP
  7. Rasputin

    Rasputin Peon

    Messages:
    1,511
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If that code is the whole code copied from your site it looks like $subject is never being defined - is it the same as $notes above it which looks like it isn't being used?
     
    Rasputin, Jul 29, 2009 IP
  8. Peter Avey

    Peter Avey Peon

    Messages:
    445
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    offtopic: why do you hide your web address to bots when you could get more backlinks but display your email address when you can loads of spam ?
     
    Peter Avey, Jul 29, 2009 IP
  9. sindimatrix

    sindimatrix Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #9
    yes it is the whole code
     
    Last edited: Jul 30, 2009
    sindimatrix, Jul 30, 2009 IP
  10. sindimatrix

    sindimatrix Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #10
    This is the latest error Parse error: syntax error, unexpected $end in \\NAS37ENT\domains\f\fusionoutside.co.uk\user\htdocs\form_process.php on line 53
     
    sindimatrix, Jul 30, 2009 IP
  11. Leron

    Leron Active Member

    Messages:
    38
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #11
    unexpected $end usually means we forget to close a statement some where.

    With your current code I would say either you may have forgotten to put a semi-colon (;) or a close bracket }

    post the code so we can help you out.
     
    Leron, Jul 30, 2009 IP