Jump to content

Parse error: parse error, unexpected T_CONSTANT_EN


virtualadz
 Share

Recommended Posts

this below code is what i tried to define but this error shows when doing anything with that code, i have given bottom starting from define with line 48 as shown in error, can anyone help.Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/bhura4/public_html/includes/languages/english/modules/payment/west.php on line 48 define('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "PAYMENT INSTRUCTIONS" . "\n\n" . 'You have two options when using Western Union' . "\n\n" . '1. Visit WesternUnion.com' . "\n" . 'Select the Money Transfer Option and follow the on screen directions' . "\n" . 'You can pay with a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Visit a local Western Union agency' . "\n" . 'Fill out the necesarry Send Money form, ask agent if you need assistance' . "\n" . 'They will require a valid ID' . "\n" . 'You can pay with cash, a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Using either method, provide the following Receiver information:' . "\n\n" . ' . MODULE_PAYMENT_WEST_PAYTO. ' . "\n\n" . 'Once payment has been sent, please send an email to this address:' ' . MODULE_PAYMENT_WEST_EMAIL. ' . "\n\n" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' ); ?>

Link to comment
Share on other sites

Try this line:<?phpdefine('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "PAYMENT INSTRUCTIONS" . "\n\n" . 'You have two options when using Western Union' . "\n\n" . '1. Visit WesternUnion.com' . "\n" . 'Select the Money Transfer Option and follow the on screen directions' . "\n" . 'You can pay with a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Visit a local Western Union agency' . "\n" . 'Fill out the necesarry Send Money form, ask agent if you need assistance' . "\n" . 'They will require a valid ID' . "\n" . 'You can pay with cash, a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Using either method, provide the following Receiver information:' . "\n\n" . MODULE_PAYMENT_WEST_PAYTO. "\n\n" . 'Once payment has been sent, please send an email to this address:' . MODULE_PAYMENT_WEST_EMAIL. "\n\n" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' );?>Using a PHP editor with syntax color highlighting is very good in such situations.

Link to comment
Share on other sites

hey it is not starting with that line rather it is this complete page<?php/*catalog\includes\languages\english\modules\payment $Id: ikobo.php, v .2beta 2004/07/10 05:39:27 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.comYou may use and distribute this software and change anything you wish accept the banners hyperlink.* * Thank you* Eugene* */ define('MODULE_PAYMENT_WEST_TEXT_TITLE', 'Western Union Money Transfer'); define('MODULE_PAYMENT_WEST_TEXT_DESCRIPTION', '<OL><P ALIGN="center"><U><B>PAYMENT INSTRUCTIONS</B></U></P> <p>(The following information will also be emailed to you after checkout) <br> You have two options when using Western Union <br> </p> <LI><SPAN CLASS="blueboldarial">Visit <a href="http://www.westernunion.com/info/selectCountry.asp" target="_blank">WesternUnion.com</a> </SPAN> </LI> <ul> <li>Select the "Money Transfer" Option and follow the on screen directions </li> <li>You can pay with a bank debit card or credit card</li> <li>Western Union will charge you a money transfer fee </li> <li>Send the amount of the total shown above</li> </ul> <li><SPAN CLASS="blueboldarial">Visit a local Western Union agency</SPAN> (<a href="http://www.westernunion.com/info/selectCountry.asp">find nearest location</a>) <ul> <li>Fill out the necesarry "Send Money" form, ask agent if you need assistance </li> <li>They will require a valid ID</li> <li>You can pay with cash, a bank debit card or credit card </li> <li>Western Union will charge you a money transfer fee</li> <li>Send the amount of the total shown above</li> </ul> </li> <li>Using either method, provide the following "Receiver" information: </li><ul> <li>'. MODULE_PAYMENT_WEST_PAYTO. '</li></ul><p>Once payment has been sent, please send an email to this address: <a href="mailto:'. MODULE_PAYMENT_WEST_EMAIL. '">'. MODULE_PAYMENT_WEST_EMAIL. '</a> Include your first and last name, your order number and the Money Transfer Control Number. Thanks!</B> </p> Please don\'t forget to click the "Confirm Order" button below. </p></OL>' ); define('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "PAYMENT INSTRUCTIONS" . "\n\n" . 'You have two options when using Western Union' . "\n\n" . '1. Visit WesternUnion.com' . "\n" . 'Select the Money Transfer Option and follow the on screen directions' . "\n" . 'You can pay with a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Visit a local Western Union agency' . "\n" . 'Fill out the necesarry Send Money form, ask agent if you need assistance' . "\n" . 'They will require a valid ID' . "\n" . 'You can pay with cash, a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Using either method, provide the following Receiver information:' . "\n\n" . ' . MODULE_PAYMENT_WEST_PAYTO. ' . "\n\n" . 'Once payment has been sent, please send an email to this address:' ' . MODULE_PAYMENT_WEST_EMAIL. ' . "\n\n" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' ); ?>

Link to comment
Share on other sites

Then replace

define('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "PAYMENT INSTRUCTIONS" . "\n\n" . 'You have two options when using Western Union' . "\n\n" . '1. Visit WesternUnion.com' . "\n" . 'Select the Money Transfer Option and follow the on screen directions' . "\n" . 'You can pay with a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Visit a local Western Union agency' . "\n" . 'Fill out the necesarry Send Money form, ask agent if you need assistance' . "\n" . 'They will require a valid ID' . "\n" . 'You can pay with cash, a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Using either method, provide the following Receiver information:' . "\n\n" . ' . MODULE_PAYMENT_WEST_PAYTO. ' . "\n\n" . 'Once payment has been sent, please send an email to this address:' ' . MODULE_PAYMENT_WEST_EMAIL. ' . "\n\n" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' );

with

define('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "PAYMENT INSTRUCTIONS" . "\n\n" . 'You have two options when using Western Union' . "\n\n" . '1. Visit WesternUnion.com' . "\n" . 'Select the Money Transfer Option and follow the on screen directions' . "\n" . 'You can pay with a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Visit a local Western Union agency' . "\n" . 'Fill out the necesarry Send Money form, ask agent if you need assistance' . "\n" . 'They will require a valid ID' . "\n" . 'You can pay with cash, a bank debit card or credit card' . "\n" . 'Western Union will charge you a money transfer fee' . "\n" . 'Send the amount of the total shown above' . "\n\n" . 'Using either method, provide the following Receiver information:' . "\n\n" . MODULE_PAYMENT_WEST_PAYTO. "\n\n" . 'Once payment has been sent, please send an email to this address:' . MODULE_PAYMENT_WEST_EMAIL. "\n\n" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' );

He simply put the <?php there to show that it was PHP, becuase it is correct, and if he used an editor with syntax-color highlighting he needed it so that it would work correctly. It's location bears no significance on his code.

Link to comment
Share on other sites

thanks it worked like a charm, but do you know how to add bulleted lists as html is not allowed here , also i did like to include spaces but   won't work as html is not allowed. only \n and \r are allowed. so can you tell how to make bulleted lists and add spaces.

Link to comment
Share on other sites

bcoz html has been shut down in admin by me, the reason being that may of my automatic emails have been auto-prepared (while installing oscommerce) with non html, so now changing them would surely result in changing many files bcoz when i activate html \n does not work and almost all of my emails pre-installed files have \n in them, when activated html supports <b> tag and not even <br> tag, so i dont want any confusions, that's the reason , i asked if there are any spaces and bullet giving tags as well. hope it is clear

Link to comment
Share on other sites

hey i included html and everything worked, but then when i add image this error message comesParse error: parse error, unexpected '.', expecting ')' in /home/bhura4/public_html/includes/languages/english/modules/payment/west.php on line 48please see this code for the imagedefine(. "<img src="http://www.bhuratea.com/images/bhura_logo.gif">" . 'MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "<u><b>PAYMENT INSTRUCTIONS</u></b>" . "<br>" . '<b>You have two options when using Western Union</b>' . "<br><br>" . '<ul><li>Visit WesternUnion.com' . "<br>" . '<li>Select the Money Transfer Option and follow the on screen directions' . "<br>" . '<li>You can pay with a bank debit card or credit card' . "<br>" . '<li>Western Union will charge you a money transfer fee' . "<br>" . '<li>Send the amount of the total shown above</ul>' . "<br><br>" . '<b>Visit a local Western Union agency</b>' . "<br>" . '<ul><li>Fill out the necesarry Send Money form, ask agent if you need assistance' . "<br>" . '<li>They will require a valid ID' . "<br>" . '<li>You can pay with cash, a bank debit card or credit card' . "<br>" . '<li>Western Union will charge you a money transfer fee' . "<br>" . '<li>Send the amount of the total shown above</ul>' . "<br><br>" . 'Using either method, provide the following Receiver information:' . "<br><br>" . MODULE_PAYMENT_WEST_PAYTO. "<br><br>" . 'Once payment has been sent, please send an email to this address:' . MODULE_PAYMENT_WEST_EMAIL. "<br><br>" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' );

Link to comment
Share on other sites

define(.Remove the .You put the image in the wrong place. The define statement starts with the constant name ('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER'), and then has the text after it. You added the image text to the very beginning, and started it with a string concatenation operator (period). Just find where you need to put the image and move it there, don't put it at the start of the define.A lot of these questions are pretty basic, you should probably be able to do most of this yourself. Take a look at Programming PHP or something to get the basic knowledge that you should have.

Link to comment
Share on other sites

Short answer (I have not tested the line, I just moved the image tags inside the value string and escaped the quotation marks):

define('MODULE_PAYMENT_WEST_TEXT_EMAIL_FOOTER', "<img src=\"http://www.bhuratea.com/images/bhura_logo.gif\"><br><u><b>PAYMENT INSTRUCTIONS</u></b>" . "<br>" . '<b>You have two options when using Western Union</b>' . "<br><br>" . '<ul><li>Visit WesternUnion.com' . "<br>" . '<li>Select the Money Transfer Option and follow the on screen directions' . "<br>" . '<li>You can pay with a bank debit card or credit card' . "<br>" . '<li>Western Union will charge you a money transfer fee' . "<br>" . '<li>Send the amount of the total shown above</ul>' . "<br><br>" . '<b>Visit a local Western Union agency</b>' . "<br>" . '<ul><li>Fill out the necesarry Send Money form, ask agent if you need assistance' . "<br>" . '<li>They will require a valid ID' . "<br>" . '<li>You can pay with cash, a bank debit card or credit card' . "<br>" . '<li>Western Union will charge you a money transfer fee' . "<br>" . '<li>Send the amount of the total shown above</ul>' . "<br><br>" . 'Using either method, provide the following Receiver information:' . "<br><br>" . MODULE_PAYMENT_WEST_PAYTO. "<br><br>" . 'Once payment has been sent, please send an email to this address:' . MODULE_PAYMENT_WEST_EMAIL. "<br><br>" . 'Include your first and last name, your order number and the Money Transfer Control Number. Thanks!' );

Long answer:Of course there's still an error there!... The < character is not allowed in constant names. justsomeguy has explained what was wrong there already. He's right, you do not have yet the basic knowledge to make changes in a PHP file by yourself.Take a look here: http://www.php.net/define to see the syntax for define() and the example there. So you are defining a constant, which has a name and a value:define('NAME','VALUE');Both are strings. The first string is the name, the second string is the value. So any changes you want to make (images, <br> tags, everything) you have to make it in the second string. The first should be left untouched.When I said in the beginning that I have escaped the quotation marks, I meant this:"B.D. once said "I don't believe in endings, I only believe in new beginnings", that's what he said"It will not work because of the quotation marks inside the string, they must be escaped like this:"B.D. once said \"I don't believe in endings, I only believe in new beginnings\", that's what he said"If there are still some things unclear, just reply :)

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...