Connecting Tech Pros Worldwide Forums | Help | Site Map

Parse error: syntax error, unexpected T_VARIABLE

Newbie
 
Join Date: Oct 2008
Posts: 11
#1: Oct 29 '08
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.
Expand|Select|Wrap|Line Numbers
  1.  <?php
  2.     $emailsubject = 'Judgement Recovery Application' ;
  3.     $web = 'mwcinvestigation@example.net' ;
  4.  
  5.  
  6.  
  7.     $casenumberField = $_POST{'Case number'};
  8.     $amountField = $_POST{'Amount of judgment:'};
  9.     $collectedField = $_POST{'Amount collected to date:'};
  10.     $stateField = $_POST{'State judgment issued:'};
  11.     $attnField = $_POST{'Represented by attorney:'};
  12.     $defaultField = $_POST{'Awarded by default:'};
  13.     $dstateField = $_POST{'JD reside in different state:'};
  14.     $namejdField = $_POST{'Name of JD:'};
  15.     $addjdField = $_POST{'JD street address:'};
  16.     $cityjdField = $_POST{'JD city, state, zip:'};
  17.     $namejcField = $_POST{'JCsName'};
  18.     $addjcField = $_POST{'JCsAddress'};
  19.     $cityjcField = $_POST{'JCsCity'};
  20.     $phoneField = $_POST{'JCsPhone'};
  21.     $emailjcField = $_POST{'JCsEmail'};
  22.     $descrpField = $_POST{'Description'};
  23.     $judgeField = $_POST{'Judgment'};
  24.  
  25.     $body = <<<EOD
  26. <br><hr><br>
  27. Email: $casenumber <br>
  28. Amount: $amount <br>
  29. Collected: $collected <br>
  30. State of Judgement: $state <br>
  31. Attorney: $attn <br>
  32. Award by Default: $default <br>
  33. JD Reside Diffent State: $dstate <br>
  34. Name: $namejd <br>
  35. Address: $addjd <br>
  36. City: $cityjd <br>
  37. Phone: $phone <br>
  38. Email: $emailjc <br>
  39. Description: $descrp <br>
  40. Judgement: $judge <br>
  41. EOD
  42.  
  43.  
  44.  
  45.     $headers = "From:emailjcField\r\n";
  46.     $headers .= "Content-type: text/html\r\n";
  47.     $success = mail($web, $emailsubject, $body, $headers);
  48.  
  49.  
  50.  
  51.     $theResults = <<<EOD
  52. <html xmlns="http://www.w3.org/1999/xhtml">
  53. <head>
  54. <meta http-equiv="Refresh" content="5; url=http://www.example.com/home.html"> 
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  56. <title>Thank you From  Hyde &amp; Seik Investigations</title>
  57. <script src="Scripts/AC_RunActiveContent.js" type="text/javascript">
  58. <style type="text/css">
  59. <!--
  60. body {
  61.     background-image: url(images/bg.jpg);
  62. }
  63. .style7 {
  64.     color: #FFFFFF;
  65.     font-weight: bold;
  66.     font-size: 18px;
  67. }
  68. .style13 {font-family: Broadway}
  69. .style15 {font-size: xx-large}
  70. -->
  71. </style></head>
  72.  
  73. <body>
  74.  
  75. <div align="center"></div>
  76. <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>
  77. <p align="center">&nbsp;</p>
  78. <p align="center">&nbsp;</p>
  79. </body>
  80. </html>
  81. EOD;
  82. echo "$theResults";
  83.  
  84.  
  85.  
  86. ?>
  87.  
  88.  
Thank you for your help

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#2: Oct 29 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Line 41 needs a semi-colon,
Newbie
 
Join Date: Oct 2008
Posts: 11
#3: Oct 29 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Thank you
Now I am getting the email but the fields are blank. Is that this code or the html code?
Thank you
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#4: Oct 29 '08

re: Parse error: syntax error, unexpected T_VARIABLE


What fields?
Newbie
 
Join Date: Oct 2008
Posts: 11
#5: Oct 29 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

Originally Posted by Markus

What fields?

All of the fields end up blank in the email
Newbie
 
Join Date: Oct 2008
Posts: 11
#6: Oct 29 '08

re: Parse error: syntax error, unexpected T_VARIABLE


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
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#7: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


The names of your POST variables look funny e.g 'Amount of judgment:'.
Try using variable names without spaces.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#8: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


I don't see the variables in your EOD set anywhere.
Newbie
 
Join Date: Oct 2008
Posts: 11
#9: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


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

Email: $casenumber

Thank you
Member
 
Join Date: Mar 2008
Posts: 60
#10: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


I'm going to agree. Try removing the spaces and see what happens.
Newbie
 
Join Date: Oct 2008
Posts: 11
#11: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


removed all the spaces and still I get the names of fields but not information that was filled out online.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#12: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

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.
Newbie
 
Join Date: Oct 2008
Posts: 11
#13: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

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
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $emailsubject = 'Judgement Recovery Application' ;
  3.     $web = '337@urmusicandvideo.com' ;
  4.  
  5.  
  6.  
  7.     $casenumberField = $_POST['Casenu'];
  8.     $amountField = $_POST['Amountofjudgment'];
  9.     $collectedField = $_POST['Amountcollected'];
  10.     $stateField = $_POST['Statejudgment'];
  11.     $attnField = $_POST['Represented'];
  12.     $defaultField = $_POST['Awardeddefault'];
  13.     $dstateField = $_POST['dstate'];
  14.     $namejdField = $_POST['JD'];
  15.     $addjdField = $_POST['JDaddress'];
  16.     $cityjdField = $_POST['JDcity'];
  17.     $namejcField = $_POST['JCsName'];
  18.     $addjcField = $_POST['JCsAddress'];
  19.     $cityjcField = $_POST['JCsCity'];
  20.     $phoneField = $_POST['JCsPhone'];
  21.     $emailjcField = $_POST['JCsEmail'];
  22.     $descrpField = $_POST['Description'];
  23.     $judgeField = $_POST['Judgment'];
  24.  
  25.     $body = <<<EOD
  26. <br><hr><br>
  27. Case Number: $casenumber <br>
  28. Amount: $amount <br>
  29. Collected: $collected <br>
  30. State of Judgement: $state <br>
  31. Attorney: $attn <br>
  32. Award by Default: $default <br>
  33. JD Reside Diffent State: $dstate <br>
  34. Name: $namejd <br>
  35. Address: $addjd <br>
  36. City: $cityjd <br>
  37. Phone: $phone <br>
  38. Email: $emailjc <br>
  39. Description: $descrp <br>
  40. Judgement: $judge <br>
  41. EOD;
  42.  
  43.  
  44.  
  45.     $headers = "From:emailjcField\r\n";
  46.     $headers .= "Content-type: text/html\n\n";
  47.     $success = mail($web, $emailsubject, $body, $headers);
  48.  
  49.  
  50.  
  51.     $theResults = <<<EOD
  52. <html xmlns="http://www.w3.org/1999/xhtml">
  53. <head>
  54. <meta http-equiv="Refresh" content="5; url=http://www.hydeandseik.com/home.html"> 
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  56. <title>Thank you From  Hyde &amp; Seik Investigations</title>
  57.  
  58. <style type="text/css">
  59. <!--
  60. body {
  61.     background-image: url(images/bg.jpg);
  62. }
  63. .style7 {
  64.     color: #FFFFFF;
  65.     font-weight: bold;
  66.     font-size: 18px;
  67. }
  68. .style13 {font-family: Broadway}
  69. .style15 {font-size: xx-large}
  70. -->
  71. </style></head>
  72.  
  73. <body>
  74.  
  75. <div align="center"></div>
  76. <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>
  77. <p align="center">&nbsp;</p>
  78. <p align="center">&nbsp;</p>
  79. </body>
  80. </html>
  81. EOD;
  82. echo "$theResults";
  83.  
  84.  
  85.  
  86. ?>
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#14: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

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?
Member
 
Join Date: Mar 2008
Posts: 60
#15: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


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

Try this:

[PHP]

$casenumberField = $_POST{'Case number'};
$amountField = $_POST{'Amount of judgment:'};
$collectedField = $_POST{'Amount collected to date:'};
$stateField = $_POST{'State judgment issued:'};
$attnField = $_POST{'Represented 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{'JCsAddress'};
$cityjcField = $_POST{'JCsCity'};
$phoneField = $_POST{'JCsPhone'};
$emailjcField = $_POST{'JCsEmail'};
$descrpField = $_POST{'Description'};
$judgeField = $_POST{'Judgment'};

$body = <<<EOD

<br><hr><br>

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

And so on....
[/PHP]
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#16: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

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

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $emailsubject = 'Judgement Recovery Application' ;
  3.     $web = '337@urmusicandvideo.com' ;
  4.  
  5.  
  6.  
  7.     $casenumberField = $_POST['Casenu'];
  8.     $amountField = $_POST['Amountofjudgment'];
  9.     $collectedField = $_POST['Amountcollected'];
  10.     $stateField = $_POST['Statejudgment'];
  11.     $attnField = $_POST['Represented'];
  12.     $defaultField = $_POST['Awardeddefault'];
  13.     $dstateField = $_POST['dstate'];
  14.     $namejdField = $_POST['JD'];
  15.     $addjdField = $_POST['JDaddress'];
  16.     $cityjdField = $_POST['JDcity'];
  17.     $namejcField = $_POST['JCsName'];
  18.     $addjcField = $_POST['JCsAddress'];
  19.     $cityjcField = $_POST['JCsCity'];
  20.     $phoneField = $_POST['JCsPhone'];
  21.     $emailjcField = $_POST['JCsEmail'];
  22.     $descrpField = $_POST['Description'];
  23.     $judgeField = $_POST['Judgment'];
  24.  
  25.     $body = <<<EOD
  26. <br><hr><br>
  27. Case Number: $casenumber <br>
  28. Amount: $amount <br>
  29. Collected: $collected <br>
  30. State of Judgement: $state <br>
  31. Attorney: $attn <br>
  32. Award by Default: $default <br>
  33. JD Reside Diffent State: $dstate <br>
  34. Name: $namejd <br>
  35. Address: $addjd <br>
  36. City: $cityjd <br>
  37. Phone: $phone <br>
  38. Email: $emailjc <br>
  39. Description: $descrp <br>
  40. Judgement: $judge <br>
  41. EOD;
  42.  
  43.  
  44.  
  45.     $headers = "From:emailjcField\r\n";
  46.     $headers .= "Content-type: text/html\n\n";
  47.     $success = mail($web, $emailsubject, $body, $headers);
  48.  
  49.  
  50.  
  51.     $theResults = <<<EOD
  52. <html xmlns="http://www.w3.org/1999/xhtml">
  53. <head>
  54. <meta http-equiv="Refresh" content="5; url=http://www.hydeandseik.com/home.html"> 
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  56. <title>Thank you From  Hyde &amp; Seik Investigations</title>
  57.  
  58. <style type="text/css">
  59. <!--
  60. body {
  61.     background-image: url(images/bg.jpg);
  62. }
  63. .style7 {
  64.     color: #FFFFFF;
  65.     font-weight: bold;
  66.     font-size: 18px;
  67. }
  68. .style13 {font-family: Broadway}
  69. .style15 {font-size: xx-large}
  70. -->
  71. </style></head>
  72.  
  73. <body>
  74.  
  75. <div align="center"></div>
  76. <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>
  77. <p align="center">&nbsp;</p>
  78. <p align="center">&nbsp;</p>
  79. </body>
  80. </html>
  81. EOD;
  82. echo "$theResults";
  83.  
  84.  
  85.  
  86. ?>

No, you declare $casenumberFiled which is not the same as $casenumber
Newbie
 
Join Date: Oct 2008
Posts: 11
#17: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

Originally Posted by Markus

No, you declare $casenumberFiled which is not the same as $casenumber

Ok
I changed all of those.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $emailsubject = 'Judgement Recovery Application' ;
  3.     $web = '337@urmusicandvideo.com' ;
  4.  
  5.  
  6.  
  7.     $casenumberField = $_POST['Casenu'];
  8.     $amountField = $_POST['Amountofjudgment'];
  9.     $collectedField = $_POST['Amountcollected'];
  10.     $stateField = $_POST['Statejudgment'];
  11.     $attnField = $_POST['Represented'];
  12.     $defaultField = $_POST['Awardeddefault'];
  13.     $dstateField = $_POST['dstate'];
  14.     $namejdField = $_POST['JD'];
  15.     $addjdField = $_POST['JDaddress'];
  16.     $cityjdField = $_POST['JDcity'];
  17.     $namejcField = $_POST['JCsName'];
  18.     $addjcField = $_POST['JCsAddress'];
  19.     $cityjcField = $_POST['JCsCity'];
  20.     $phoneField = $_POST['JCsPhone'];
  21.     $emailjcField = $_POST['JCsEmail'];
  22.     $descrpField = $_POST['Description'];
  23.     $judgeField = $_POST['Judgment'];
  24.  
  25.     $body = <<<EOD
  26. <br><hr><br>
  27. Case Number: $casenumberField <br>
  28. Amount: $amountField <br>
  29. Collected: $collectedField <br>
  30. State of Judgement: $stateField <br>
  31. Attorney: $attnField <br>
  32. Award by Default: $defaultField <br>
  33. JD Reside Diffent State: $dstateField <br>
  34. Name: $namejdField <br>
  35. Address: $addjdField <br>
  36. City: $cityjdField <br>
  37. Phone: $phoneField <br>
  38. Email: $emailjcField <br>
  39. Description: $descrpField <br>
  40. Judgement: $judgeField <br>
  41. EOD;
  42.  
  43.  
  44.  
  45.     $headers = "From:emailjcField\r\n";
  46.     $headers .= "Content-type: text/html\n\n";
  47.     $success = mail($web, $emailsubject, $body, $headers);
  48.  
  49.  
  50.  
  51.     $theResults = <<<EOD
  52. <html xmlns="http://www.w3.org/1999/xhtml">
  53. <head>
  54. <meta http-equiv="Refresh" content="5; url=http://www.hydeandseik.com/home.html"> 
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  56. <title>Thank you From  Hyde &amp; Seik Investigations</title>
  57.  
  58. <style type="text/css">
  59. <!--
  60. body {
  61.     background-image: url(images/bg.jpg);
  62. }
  63. .style7 {
  64.     color: #FFFFFF;
  65.     font-weight: bold;
  66.     font-size: 18px;
  67. }
  68. .style13 {font-family: Broadway}
  69. .style15 {font-size: xx-large}
  70. -->
  71. </style></head>
  72.  
  73. <body>
  74.  
  75. <div align="center"></div>
  76. <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>
  77. <p align="center">&nbsp;</p>
  78. <p align="center">&nbsp;</p>
  79. </body>
  80. </html>
  81. EOD;
  82. echo "$theResults";
  83.  
  84.  
  85.  
  86. ?>
  87.  
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
Member
 
Join Date: Mar 2008
Posts: 60
#18: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


[PHP]

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'] ;

[/PHP]

Try that. :)
Newbie
 
Join Date: Oct 2008
Posts: 11
#19: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

Originally Posted by AutumnsDecay

[PHP]

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'] ;

[/PHP]

Try that. :)

Where do I put it? line 27 to 40?
Thank you
Member
 
Join Date: Mar 2008
Posts: 60
#20: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

Originally Posted by URmusicandvideo

Where do I put it? line 27 to 40?
Thank you

That's exactly where you would put it.
Newbie
 
Join Date: Oct 2008
Posts: 11
#21: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

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
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $emailsubject = 'Judgement Recovery Application' ;
  3.     $web = '337@urmusicandvideo.com' ;
  4.  
  5.  
  6.  
  7.     $casenumberField = $_POST['Casenu'];
  8.     $amountField = $_POST['Amountofjudgment'];
  9.     $collectedField = $_POST['Amountcollected'];
  10.     $stateField = $_POST['Statejudgment'];
  11.     $attnField = $_POST['Represented'];
  12.     $defaultField = $_POST['Awardeddefault'];
  13.     $dstateField = $_POST['dstate'];
  14.     $namejdField = $_POST['JD'];
  15.     $addjdField = $_POST['JDaddress'];
  16.     $cityjdField = $_POST['JDcity'];
  17.     $namejcField = $_POST['JCsName'];
  18.     $addjcField = $_POST['JCsAddress'];
  19.     $cityjcField = $_POST['JCsCity'];
  20.     $phoneField = $_POST['JCsPhone'];
  21.     $emailjcField = $_POST['JCsEmail'];
  22.     $descrpField = $_POST['Description'];
  23.     $judgeField = $_POST['Judgment'];
  24.  
  25.     $body = <<<EOD
  26. <br><hr><br>
  27. Case Number: $_REQUEST['casenumberField'] ; 
  28. \n Amount: $_REQUEST['amountField'] ;   
  29. \n Collected: $_REQUEST['collectedField'] ; 
  30. \n State of Judgement: $_REQUEST['stateField'] ;  
  31. \n Attorney: $_REQUEST['attnField'] ;  
  32. \n Award by Default: $_REQUEST['defaultField'] ;  
  33. \n JD Reside Diffent State: $_REQUEST['dstateField'] ;  
  34. \n Name: $_REQUEST['namejdField'] ;  
  35. \n Address: $_REQUEST['addjdField'] ;  
  36. \n City: $_REQUEST['cityjdField'] ;  
  37. \n Phone: $_REQUEST['phoneField'] ;  
  38. \n Email: $_REQUEST['emailjcField'] ;  
  39. \n Description: $_REQUEST['descrpField'] ;  
  40. \n Judgement: $_REQUEST['judgeField'] ;
  41. EOD;
  42.  
  43.  
  44.  
  45.     $headers = "From:emailjcField\r\n";
  46.     $headers .= "Content-type: text/html\n\n";
  47.     $success = mail($web, $emailsubject, $body, $headers);
  48.  
  49.  
  50.  
  51.     $theResults = <<<EOD
  52. <html xmlns="http://www.w3.org/1999/xhtml">
  53. <head>
  54. <meta http-equiv="Refresh" content="5; url=http://www.hydeandseik.com/home.html"> 
  55. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  56. <title>Thank you From  Hyde &amp; Seik Investigations</title>
  57.  
  58. <style type="text/css">
  59. <!--
  60. body {
  61.     background-image: url(images/bg.jpg);
  62. }
  63. .style7 {
  64.     color: #FFFFFF;
  65.     font-weight: bold;
  66.     font-size: 18px;
  67. }
  68. .style13 {font-family: Broadway}
  69. .style15 {font-size: xx-large}
  70. -->
  71. </style></head>
  72.  
  73. <body>
  74.  
  75. <div align="center"></div>
  76. <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>
  77. <p align="center">&nbsp;</p>
  78. <p align="center">&nbsp;</p>
  79. </body>
  80. </html>
  81. EOD;
  82. echo "$theResults";
  83.  
  84.  
  85.  
  86. ?>
  87.  
Thank you for all your help
Member
 
Join Date: Mar 2008
Posts: 60
#22: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


[PHP]

$cn = "\n Case Number: ";
$cn .= $_REQUEST['casenumberField'] ;
$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.
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#23: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


This is dragging.

Do this at the top of that file
Expand|Select|Wrap|Line Numbers
  1. echo '<pre>';
  2. print_r($_POST);
  3. echo '</pre>';
  4.  
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.
Member
 
Join Date: Mar 2008
Posts: 60
#24: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


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

Hopefully your advice helps him out, though.
Newbie
 
Join Date: Oct 2008
Posts: 11
#25: Oct 30 '08

re: Parse error: syntax error, unexpected T_VARIABLE


Quote:

Originally Posted by Markus

This is dragging.

Do this at the top of that file

Expand|Select|Wrap|Line Numbers
  1. echo '<pre>';
  2. print_r($_POST);
  3. echo '</pre>';
  4.  
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
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $emailsubject = 'Judgement Recovery Application' ;
  3.     $web = '337@urmusicandvideo.com' ;
  4.  
  5.  
  6.     echo '<pre>'; 
  7. print_r($_POST); 
  8. echo '</pre>';
  9.  
  10.  
  11.     $casenumberField = $_POST['Casenu'];
  12.     $amountField = $_POST['Amountofjudgment'];
  13.     $collectedField = $_POST['Amountcollected'];
  14.     $stateField = $_POST['Statejudgment'];
  15.     $attnField = $_POST['Represented'];
  16.     $defaultField = $_POST['Awardeddefault'];
  17.     $dstateField = $_POST['dstate'];
  18.     $namejdField = $_POST['JD'];
  19.     $addjdField = $_POST['JDaddress'];
  20.     $cityjdField = $_POST['JDcity'];
  21.     $namejcField = $_POST['JCsName'];
  22.     $addjcField = $_POST['JCsAddress'];
  23.     $cityjcField = $_POST['JCsCity'];
  24.     $phoneField = $_POST['JCsPhone'];
  25.     $emailjcField = $_POST['JCsEmail'];
  26.     $descrpField = $_POST['Description'];
  27.     $judgeField = $_POST['Judgment'];
  28.  
  29.     $body = <<<EOD
  30. <br><hr><br>
  31.  
  32. $cn = "\n Case Number: "; 
  33. $cn .= $_POST['casenumberField'] ;   
  34. $am = "\n Amount: "; 
  35. $am .= $_POST['amountField'] ;     
  36. $col = "\n Collected: "; 
  37. $col .= $_POST['collectedField'] ;   
  38. $soj = "\n State of Judgement: "; 
  39. $soj .= $_POST['stateField'] ;    
  40. $att = "\n Attorney: "; 
  41. $att .= $_POST['attnField'] ;    
  42. $abd = "\n Award by Default: "; 
  43. $abd .= $_POST['defaultField'] ;    
  44. $jdr = "\n JD Reside Diffent State: "; 
  45. $jdr .= $_POST['dstateField'] ;    
  46. $nam = "\n Name: "; 
  47. $nam .= $_POST['namejdField'] ;    
  48. $addr = "\n Address: "; 
  49. $addr .= $_POST['addjdField'] ;    
  50. $cit = "\n City: "; 
  51. $cit .= $_POST['cityjdField'] ;    
  52. $phn = "\n Phone: "; 
  53. $phn .= $_POST['phoneField'] ;    
  54. $ema = "\n Email: "; 
  55. $ema .= $_POST['emailjcField'] ;    
  56. $desc = "\n Description: "; 
  57. $desc .= $_POST['descrpField'] ;    
  58. $jumt = "\n Judgement: "; 
  59. $jumt .= $_POST['judgeField'] ;  
  60.  
  61.  
  62. EOD;
  63.  
  64.  
  65.  
  66.     $headers = "From:emailjcField\r\n";
  67.     $headers .= "Content-type: text/html\n\n";
  68.     $success = mail($web, $emailsubject, $body, $headers);
  69.  
  70.  
  71.  
  72.     $theResults = <<<EOD
  73. <html xmlns="http://www.w3.org/1999/xhtml">
  74. <head>
  75. <meta http-equiv="Refresh" content="5; url=http://www.hydeandseik.com/home.html"> 
  76. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  77. <title>Thank you From  Hyde &amp; Seik Investigations</title>
  78.  
  79. <style type="text/css">
  80. <!--
  81. body {
  82.     background-image: url(images/bg.jpg);
  83. }
  84. .style7 {
  85.     color: #FFFFFF;
  86.     font-weight: bold;
  87.     font-size: 18px;
  88. }
  89. .style13 {font-family: Broadway}
  90. .style15 {font-size: xx-large}
  91. -->
  92. </style></head>
  93.  
  94. <body>
  95.  
  96. <div align="center"></div>
  97. <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>
  98. <p align="center">&nbsp;</p>
  99. <p align="center">&nbsp;</p>
  100. </body>
  101. </html>
  102. EOD;
  103. echo "$theResults";
  104.  
  105.  
  106.  
  107. ?>
  108.  
I am just not sure where to put the three lines you gave me. Did I put them in the right spot?
Thankyou Agian
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#26: Oct 31 '08

re: Parse error: syntax error, unexpected T_VARIABLE


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?
Reply