Can someone help with this php script please

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

  1. #1
    I am trying to get this form to work but at www.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 dreamwevaer 8 by the way
     
    sindimatrix, Jul 29, 2009 IP
  3. sindimatrix

    sindimatrix Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    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
  4. zandigo

    zandigo Greenhorn

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Why do you put
    die ("Thank you for contacting us we will contact you soon!! "); {
    PHP:
    at the beginning of you code? It will stop executing right after this command. Move it to the end of your code, and delete the curly bracket. Then, it will no longer be an error.
     
    zandigo, Jul 29, 2009 IP
  5. silotka

    silotka Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <?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'];




    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);
    echo "Thank you for contacting us we will contact you soon!! ";
    ?>
     
    silotka, Jul 31, 2009 IP
  6. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Kindly copy the entire code in form_process.php file. Or atleast mark out the 56th line with Red Backcolor and post the code again. Zandigo is correct. This is a fact, you'll never get your email sent, until you move the die() function at the end of the code. But it seems, there are more errors. Because, the error you're getting is because of an unclosed bracket or inverted comma.
     
    techbongo, Jul 31, 2009 IP