Parse error: syntax error, unexpected T_VARIABLE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #16
    Originally posted by URmusicandvideo
    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";
    
    
    
    ?>
    No, you declare $casenumberFile d which is not the same as $casenumber

    Comment

    • URmusicandvideo
      New Member
      • Oct 2008
      • 11

      #17
      Originally posted by Markus
      No, you declare $casenumberFile d which is not the same as $casenumber
      Ok
      I changed all of those.
      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: $casenumberField <br>
      Amount: $amountField <br>
      Collected: $collectedField <br>
      State of Judgement: $stateField <br>
      Attorney: $attnField <br>
      Award by Default: $defaultField <br>
      JD Reside Diffent State: $dstateField <br>
      Name: $namejdField <br>
      Address: $addjdField <br>
      City: $cityjdField <br>
      Phone: $phoneField <br>
      Email: $emailjcField <br>
      Description: $descrpField <br>
      Judgement: $judgeField <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";
      
      
      
      ?>
      and still this is what I am getting in my email:
      --------------------------------------------------------------------------------

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

      Comment

      • AutumnsDecay
        New Member
        • Mar 2008
        • 170

        #18
        [PHP]

        Case Number: $_REQUEST['casenumberFiel d'] ;
        \n Amount: $_REQUEST['amountField'] ;
        \n Collected: $_REQUEST['collectedField '] ;
        \n State of Judgement: $_REQUEST['stateField'] ;
        \n Attorney: $_REQUEST['attnField'] ;
        \n Award by Default: $_REQUEST['defaultField'] ;
        \n JD Reside Diffent State: $_REQUEST['dstateField'] ;
        \n Name: $_REQUEST['namejdField'] ;
        \n Address: $_REQUEST['addjdField'] ;
        \n City: $_REQUEST['cityjdField'] ;
        \n Phone: $_REQUEST['phoneField'] ;
        \n Email: $_REQUEST['emailjcField'] ;
        \n Description: $_REQUEST['descrpField'] ;
        \n Judgement: $_REQUEST['judgeField'] ;

        [/PHP]

        Try that. :)

        Comment

        • URmusicandvideo
          New Member
          • Oct 2008
          • 11

          #19
          Originally posted by AutumnsDecay
          [PHP]

          Case Number: $_REQUEST['casenumberFiel d'] ;
          \n Amount: $_REQUEST['amountField'] ;
          \n Collected: $_REQUEST['collectedField '] ;
          \n State of Judgement: $_REQUEST['stateField'] ;
          \n Attorney: $_REQUEST['attnField'] ;
          \n Award by Default: $_REQUEST['defaultField'] ;
          \n JD Reside Diffent State: $_REQUEST['dstateField'] ;
          \n Name: $_REQUEST['namejdField'] ;
          \n Address: $_REQUEST['addjdField'] ;
          \n City: $_REQUEST['cityjdField'] ;
          \n Phone: $_REQUEST['phoneField'] ;
          \n Email: $_REQUEST['emailjcField'] ;
          \n Description: $_REQUEST['descrpField'] ;
          \n Judgement: $_REQUEST['judgeField'] ;

          [/PHP]

          Try that. :)
          Where do I put it? line 27 to 40?
          Thank you

          Comment

          • AutumnsDecay
            New Member
            • Mar 2008
            • 170

            #20
            Originally posted by URmusicandvideo
            Where do I put it? line 27 to 40?
            Thank you
            That's exactly where you would put it.

            Comment

            • URmusicandvideo
              New Member
              • Oct 2008
              • 11

              #21
              Originally posted by URmusicandvideo
              Where do I put it? line 27 to 40?
              Thank you
              OK I did it and I get this error
              Parse error: syntax error, unexpected T_ENCAPSED_AND_ WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/hydeands/public_html/phpmail.php on line 27

              Here is the new code too
              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: $_REQUEST['casenumberField'] ; 
              \n Amount: $_REQUEST['amountField'] ;   
              \n Collected: $_REQUEST['collectedField'] ; 
              \n State of Judgement: $_REQUEST['stateField'] ;  
              \n Attorney: $_REQUEST['attnField'] ;  
              \n Award by Default: $_REQUEST['defaultField'] ;  
              \n JD Reside Diffent State: $_REQUEST['dstateField'] ;  
              \n Name: $_REQUEST['namejdField'] ;  
              \n Address: $_REQUEST['addjdField'] ;  
              \n City: $_REQUEST['cityjdField'] ;  
              \n Phone: $_REQUEST['phoneField'] ;  
              \n Email: $_REQUEST['emailjcField'] ;  
              \n Description: $_REQUEST['descrpField'] ;  
              \n Judgement: $_REQUEST['judgeField'] ;
              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";
              
              
              
              ?>
              Thank you for all your help

              Comment

              • AutumnsDecay
                New Member
                • Mar 2008
                • 170

                #22
                [PHP]

                $cn = "\n Case Number: ";
                $cn .= $_REQUEST['casenumberFiel d'] ;
                $am = "\n Amount: ";
                $am .= $_REQUEST['amountField'] ;
                $col = "\n Collected: ";
                $col .= $_REQUEST['collectedField '] ;
                $soj = "\n State of Judgement: ";
                $soj .= $_REQUEST['stateField'] ;
                $att = "\n Attorney: ";
                $att .= $_REQUEST['attnField'] ;
                $abd = "\n Award by Default: ";
                $abd .= $_REQUEST['defaultField'] ;
                $jdr = "\n JD Reside Diffent State: ";
                $jdr .= $_REQUEST['dstateField'] ;
                $nam = "\n Name: ";
                $nam .= $_REQUEST['namejdField'] ;
                $addr = "\n Address: ";
                $addr .= $_REQUEST['addjdField'] ;
                $cit = "\n City: ";
                $cit .= $_REQUEST['cityjdField'] ;
                $phn = "\n Phone: ";
                $phn .= $_REQUEST['phoneField'] ;
                $ema = "\n Email: ";
                $ema .= $_REQUEST['emailjcField'] ;
                $desc = "\n Description: ";
                $desc .= $_REQUEST['descrpField'] ;
                $jumt = "\n Judgement: ";
                $jumt .= $_REQUEST['judgeField'] ;

                [/PHP]

                Try that. If it doesn't work, I don't know what to tell you.

                Comment

                • Markus
                  Recognized Expert Expert
                  • Jun 2007
                  • 6092

                  #23
                  This is dragging.

                  Do this at the top of that file
                  Code:
                  echo '<pre>';
                  print_r($_POST);
                  echo '</pre>';
                  and then show us the results.

                  and what's the point in using REQUEST? It's slower because it checks COOKIE, GET and POST. If you know where the data is, then use that instead of REQUEST.

                  Comment

                  • AutumnsDecay
                    New Member
                    • Mar 2008
                    • 170

                    #24
                    I use REQUEST on all my mailforms, and I don't notice it being slow at all.

                    Hopefully your advice helps him out, though.

                    Comment

                    • URmusicandvideo
                      New Member
                      • Oct 2008
                      • 11

                      #25
                      Originally posted by Markus
                      This is dragging.

                      Do this at the top of that file
                      Code:
                      echo '<pre>';
                      print_r($_POST);
                      echo '</pre>';
                      and then show us the results.

                      and what's the point in using REQUEST? It's slower because it checks COOKIE, GET and POST. If you know where the data is, then use that instead of REQUEST.
                      I tryed it but now I get this error Parse error: syntax error, unexpected T_ENCAPSED_AND_ WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/hydeands/public_html/phpmail.php on line 33


                      Here is the code
                      Code:
                      <?php
                      	$emailsubject = 'Judgement Recovery Application' ;
                      	$web = '337@urmusicandvideo.com' ;
                      	
                      	
                      	echo '<pre>'; 
                      print_r($_POST); 
                      echo '</pre>';
                      
                      
                      	$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>
                        
                      $cn = "\n Case Number: "; 
                      $cn .= $_POST['casenumberField'] ;   
                      $am = "\n Amount: "; 
                      $am .= $_POST['amountField'] ;     
                      $col = "\n Collected: "; 
                      $col .= $_POST['collectedField'] ;   
                      $soj = "\n State of Judgement: "; 
                      $soj .= $_POST['stateField'] ;    
                      $att = "\n Attorney: "; 
                      $att .= $_POST['attnField'] ;    
                      $abd = "\n Award by Default: "; 
                      $abd .= $_POST['defaultField'] ;    
                      $jdr = "\n JD Reside Diffent State: "; 
                      $jdr .= $_POST['dstateField'] ;    
                      $nam = "\n Name: "; 
                      $nam .= $_POST['namejdField'] ;    
                      $addr = "\n Address: "; 
                      $addr .= $_POST['addjdField'] ;    
                      $cit = "\n City: "; 
                      $cit .= $_POST['cityjdField'] ;    
                      $phn = "\n Phone: "; 
                      $phn .= $_POST['phoneField'] ;    
                      $ema = "\n Email: "; 
                      $ema .= $_POST['emailjcField'] ;    
                      $desc = "\n Description: "; 
                      $desc .= $_POST['descrpField'] ;    
                      $jumt = "\n Judgement: "; 
                      $jumt .= $_POST['judgeField'] ;  
                        
                      
                      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";
                      
                      
                      
                      ?>
                      I am just not sure where to put the three lines you gave me. Did I put them in the right spot?
                      Thankyou Agian

                      Comment

                      • r035198x
                        MVP
                        • Sep 2006
                        • 13225

                        #26
                        Let me ask again. Are you sure that there is an html form which is passing those variables that you are trying to get from $_POST and that those variables are named exactly as you are trying to get them?

                        Comment

                        Working...