Parse error: syntax error, unexpected T_VARIABLE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • URmusicandvideo
    New Member
    • Oct 2008
    • 11

    Parse error: syntax error, unexpected T_VARIABLE

    I have just finshed my first php code and posted it online and I am getting a Parse error: syntax error, unexpected T_VARIABLE in /home/hydeands/public_html/phpmail.php on line 45
    But when I look at it it looks ok.
    . I am just creating a php for a online form to direct the email.
    Here is the code.
    [code=php] <?php
    $emailsubject = 'Judgement Recovery Application' ;
    $web = 'mwcinvestigati on@example.net' ;



    $casenumberFiel d = $_POST{'Case number'};
    $amountField = $_POST{'Amount of judgment:'};
    $collectedField = $_POST{'Amount collected to date:'};
    $stateField = $_POST{'State judgment issued:'};
    $attnField = $_POST{'Represe nted by attorney:'};
    $defaultField = $_POST{'Awarded by default:'};
    $dstateField = $_POST{'JD reside in different state:'};
    $namejdField = $_POST{'Name of JD:'};
    $addjdField = $_POST{'JD street address:'};
    $cityjdField = $_POST{'JD city, state, zip:'};
    $namejcField = $_POST{'JCsName '};
    $addjcField = $_POST{'JCsAddr ess'};
    $cityjcField = $_POST{'JCsCity '};
    $phoneField = $_POST{'JCsPhon e'};
    $emailjcField = $_POST{'JCsEmai l'};
    $descrpField = $_POST{'Descrip tion'};
    $judgeField = $_POST{'Judgmen t'};

    $body = <<<EOD
    <br><hr><br>
    Email: $casenumber <br>
    Amount: $amount <br>
    Collected: $collected <br>
    State of Judgement: $state <br>
    Attorney: $attn <br>
    Award by Default: $default <br>
    JD Reside Diffent State: $dstate <br>
    Name: $namejd <br>
    Address: $addjd <br>
    City: $cityjd <br>
    Phone: $phone <br>
    Email: $emailjc <br>
    Description: $descrp <br>
    Judgement: $judge <br>
    EOD



    $headers = "From:emailjcFi eld\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($web, $emailsubject, $body, $headers);



    $theResults = <<<EOD
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Refresh" content="5; url=http://www.example.com/home.html">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Thank you From Hyde &amp; Seik Investigations</title>
    <script src="Scripts/AC_RunActiveCon tent.js" type="text/javascript">
    <style type="text/css">
    <!--
    body {
    background-image: url(images/bg.jpg);
    }
    .style7 {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 18px;
    }
    .style13 {font-family: Broadway}
    .style15 {font-size: xx-large}
    -->
    </style></head>

    <body>

    <div align="center"> </div>
    <h1 align="center" class="style7"> <span class="style15" ><span class="style13" >Hyde &amp; Seik</span>®</span><span class="style15" > Thanks you for your application and we will be in contact with you soon.</span></h1>
    <p align="center"> &nbsp;</p>
    <p align="center"> &nbsp;</p>
    </body>
    </html>
    EOD;
    echo "$theResult s";



    ?>

    [/code]
    Thank you for your help
    Last edited by Atli; Oct 29 '08, 01:44 AM. Reason: Replaced real URL and email with example values.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Line 41 needs a semi-colon,

    Comment

    • URmusicandvideo
      New Member
      • Oct 2008
      • 11

      #3
      Thank you
      Now I am getting the email but the fields are blank. Is that this code or the html code?
      Thank you

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        What fields?

        Comment

        • URmusicandvideo
          New Member
          • Oct 2008
          • 11

          #5
          Originally posted by Markus
          What fields?
          All of the fields end up blank in the email

          Comment

          • URmusicandvideo
            New Member
            • Oct 2008
            • 11

            #6
            Email:
            Amount:
            Collected:
            State of Judgement:
            Attorney:
            Award by Default:
            JD Reside Diffent State:
            Name:
            Address:
            City:
            Phone:
            Email:
            Description:
            Judgement:

            This is all I get in my email not the information filled out by customers.
            Maybe fields is the wrong word, Sorry
            Thank you

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              The names of your POST variables look funny e.g 'Amount of judgment:'.
              Try using variable names without spaces.

              Comment

              • Markus
                Recognized Expert Expert
                • Jun 2007
                • 6092

                #8
                I don't see the variables in your EOD set anywhere.

                Comment

                • URmusicandvideo
                  New Member
                  • Oct 2008
                  • 11

                  #9
                  I thougght that the varibles were set in lines 27 to 40. Did I not do them correctly?

                  Email: $casenumber

                  Thank you

                  Comment

                  • AutumnsDecay
                    New Member
                    • Mar 2008
                    • 170

                    #10
                    I'm going to agree. Try removing the spaces and see what happens.

                    Comment

                    • URmusicandvideo
                      New Member
                      • Oct 2008
                      • 11

                      #11
                      removed all the spaces and still I get the names of fields but not information that was filled out online.

                      Comment

                      • Markus
                        Recognized Expert Expert
                        • Jun 2007
                        • 6092

                        #12
                        Originally posted by URmusicandvideo
                        I thougght that the varibles were set in lines 27 to 40. Did I not do them correctly?

                        Email: $casenumber

                        Thank you
                        But where is $casenumber declared? I don't see that.

                        Comment

                        • URmusicandvideo
                          New Member
                          • Oct 2008
                          • 11

                          #13
                          Originally posted by Markus
                          But where is $casenumber declared? I don't see that.
                          Isn't that in line 7??

                          Thank you sir
                          I did change the spaces out of the titles. here is the new code
                          Code:
                          <?php
                          	$emailsubject = 'Judgement Recovery Application' ;
                          	$web = '337@urmusicandvideo.com' ;
                          	
                          
                          
                          	$casenumberField = $_POST['Casenu'];
                          	$amountField = $_POST['Amountofjudgment'];
                          	$collectedField = $_POST['Amountcollected'];
                          	$stateField = $_POST['Statejudgment'];
                          	$attnField = $_POST['Represented'];
                          	$defaultField = $_POST['Awardeddefault'];
                          	$dstateField = $_POST['dstate'];
                          	$namejdField = $_POST['JD'];
                          	$addjdField = $_POST['JDaddress'];
                          	$cityjdField = $_POST['JDcity'];
                          	$namejcField = $_POST['JCsName'];
                          	$addjcField = $_POST['JCsAddress'];
                          	$cityjcField = $_POST['JCsCity'];
                          	$phoneField = $_POST['JCsPhone'];
                          	$emailjcField = $_POST['JCsEmail'];
                          	$descrpField = $_POST['Description'];
                          	$judgeField = $_POST['Judgment'];
                          	
                          	$body = <<<EOD
                          <br><hr><br>
                          Case Number: $casenumber <br>
                          Amount: $amount <br>
                          Collected: $collected <br>
                          State of Judgement: $state <br>
                          Attorney: $attn <br>
                          Award by Default: $default <br>
                          JD Reside Diffent State: $dstate <br>
                          Name: $namejd <br>
                          Address: $addjd <br>
                          City: $cityjd <br>
                          Phone: $phone <br>
                          Email: $emailjc <br>
                          Description: $descrp <br>
                          Judgement: $judge <br>
                          EOD;
                          
                          
                          
                          	$headers = "From:emailjcField\r\n";
                          	$headers .= "Content-type: text/html\n\n";
                          	$success = mail($web, $emailsubject, $body, $headers);
                          	
                          	
                          	
                          	$theResults = <<<EOD
                          <html xmlns="http://www.w3.org/1999/xhtml">
                          <head>
                          <meta http-equiv="Refresh" content="5; url=http://www.hydeandseik.com/home.html"> 
                          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                          <title>Thank you From  Hyde &amp; Seik Investigations</title>
                          
                          <style type="text/css">
                          <!--
                          body {
                          	background-image: url(images/bg.jpg);
                          }
                          .style7 {
                          	color: #FFFFFF;
                          	font-weight: bold;
                          	font-size: 18px;
                          }
                          .style13 {font-family: Broadway}
                          .style15 {font-size: xx-large}
                          -->
                          </style></head>
                          
                          <body>
                          
                          <div align="center"></div>
                          <h1 align="center" class="style7"><span class="style15"><span class="style13">Hyde &amp; Seik</span>®</span><span class="style15"> Thanks you for your application and we will be in contact with you soon.</span></h1>
                          <p align="center">&nbsp;</p>
                          <p align="center">&nbsp;</p>
                          </body>
                          </html>
                          EOD;
                          echo "$theResults";
                          
                          
                          
                          ?>

                          Comment

                          • r035198x
                            MVP
                            • Sep 2006
                            • 13225

                            #14
                            Originally posted by URmusicandvideo
                            Isn't that in line 7??

                            Thank you sir
                            How about removing those spaces in the variable names? What does the html file that sends them look like?

                            Comment

                            • AutumnsDecay
                              New Member
                              • Mar 2008
                              • 170

                              #15
                              You're posting the information, but you're not requesting it once the email is sent.

                              Try this:

                              [PHP]

                              $casenumberFiel d = $_POST{'Case number'};
                              $amountField = $_POST{'Amount of judgment:'};
                              $collectedField = $_POST{'Amount collected to date:'};
                              $stateField = $_POST{'State judgment issued:'};
                              $attnField = $_POST{'Represe nted by attorney:'};
                              $defaultField = $_POST{'Awarded by default:'};
                              $dstateField = $_POST{'JD reside in different state:'};
                              $namejdField = $_POST{'Name of JD:'};
                              $addjdField = $_POST{'JD street address:'};
                              $cityjdField = $_POST{'JD city, state, zip:'};
                              $namejcField = $_POST{'JCsName '};
                              $addjcField = $_POST{'JCsAddr ess'};
                              $cityjcField = $_POST{'JCsCity '};
                              $phoneField = $_POST{'JCsPhon e'};
                              $emailjcField = $_POST{'JCsEmai l'};
                              $descrpField = $_POST{'Descrip tion'};
                              $judgeField = $_POST{'Judgmen t'};

                              $body = <<<EOD

                              <br><hr><br>

                              $email = "\n Email: ";
                              $email .= $_REQUEST['casenumber'] ;
                              $amounte = "\n Amount: ";
                              $amounte .= $_REQUEST['amount'] ;

                              And so on....
                              [/PHP]

                              Comment

                              Working...