Little Help?

    Date: 01/27/06 (PHP Community)    Keywords: php, html, web

    I've got this mailing script, it's a work in progress, I'm getting  this error:

    Parse error
    : parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/xxxx/public_html/mailer2.php on line 55

    Line 55 is this: $form .= "

    ";

    Any ideas why?


    #assign form values
    $name = $_POST['name'];
    $mail = $_POST['email'];
    $phone = $_POST['telephone'];
    $message = $_POST['message'];
    $sent = $_POST['submit'];

    #HTML page to be written
    $form = $head;
    $form .= "
    ";
    $form .= $nav;
    $form .= "
    ";
    $form .= "If you wish to contact us for any reason please don't hesitate to do so. Details of how to contact us can be found below:";
    $form .= "

    E-mail: xx@xxx.co.uk";
    $form .= "
    ";
    $form .= "Telephone: xxxxx Note: This is a temporary number, we will have a land line soon.
    ";
    $form .= "MSN Messenger: xxx@xxx.co.uk";
    $form .= "
    ";
    $form .= "ICQ: xxxxxxxx

    ";
    $form .= "

    Or alternatively you can use the form below to contact us.

    ";
    $form .= "
    ";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= ""
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "";
    $form .= "
    Name:
    E-mail:
    Telephone:
    Message:
    ";
    $form .= "";
    $form .= "
    ";
    $form .= "
    ";
    $form .= "
    ";
    $form .= "
    ";
    $form .= $footer

    #execute code if form has been submitted once
    if ($sent)
        {
            $valid=true; #set variable default value
                if (!$name) #check name field not blank
                    {
                        $errmsg .= "Please go back and enter your name
    ";
                        $valid=false;
                    }
                if (!$mail)#check E-mail field not blank
                    {
                        $errmsg .= "Please go back and enter your E-Mail address
    ";
                        $valid=false;
                    }
                if (!$phone) #check Phone No. field not blank
                    {
                        $errmsg .= "Please go back and enter your Phone Number
    ";
                        $valid=false;
                    }
                if (!$message) #check Message field not blank
                    {
                        $errmsg .= "Please go back and enter your Message
    ";
                        $valid=false;
                    }
            }
        if ( $valid != true ) # if not valid write this
            {
                echo ( "$errmsg . $form" );
            }
        else #if valid send e-mail
        {
            $to = "xxx@xxxx.co.uk";
            $re = "Website Enquiry";
            $msg = "Name: $name";
            $msg .= "

    Telephone: $phone

    ";
            $msg .= "

    Message: $message

    ";
            $headers = "MIME-Version: 1.0\r\n";
            $headers .= "Content-type: text/html;";
            $headers .= " charset=iso-8859-1\r\n";
            $headers .= "From: $email \r\n";
        if (mail ( $to, $re, $msg, $headers ) )
            {
                echo ( "$head
    $nav 

    Thankyou for your enquiry.

    Message from $name \($mail\) has been sent
    We will reply shortly

    The xxxxxx Team

    $footer" );

    Source: http://community.livejournal.com/php/403005.html

« PHP client for asp.net... || php and xml »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home