944,179 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 823
  • PHP RSS
Dec 4th, 2007
0

syntax error, unexpected T_STRING

Expand Post »
Hi,
I am trying to code to put a PayPal logo in a page. Here is the code:

<?php 
// ----------------------------------- 
// PAYPAL ACCEPTED ITEM 
// ----------------------------------- 

// test if box should be displayed 
$show_MYK_PAYPAL = true; 

if ($show_MYK_PAYPAL == true) { 
?> 

<div align="center" style="padding:5px;"> 
<!-- PayPal Logo --><table border="0" cellpadding="10" cellspacing="0" align="center"><tr><td align="center"></td></tr>
<tr><td align="center"><a href="#" onclick="javascript:window.open('https://www.paypal.com/uk/cgi-bin/webscr?cmd=xpt/cps/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');"><img src="https://www.paypal.com/en_GB/i/bnr/vertical_solution_PP.gif" border="0" alt="Solution Graphics"></a></td></tr></table><!-- PayPal Logo --> 
</div> 

<?php } 
?>

The bit I have highlighted red is straight from the PayPal web site. I am getting the following error message:
Parse error: syntax error, unexpected T_STRING in MYK_PAYPAL.php on line 7
Line 7 is the one that says: $show_MYK_PAYPAL = true;

I am no expert in PHP, in fact I have never programmed in PHP... if anyone can say what the problem might be I would be very grateful.

Thanks.
rtx
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rtx is offline Offline
1 posts
since Dec 2007
Dec 4th, 2007
0

Re: syntax error, unexpected T_STRING

PHP Syntax (Toggle Plain Text)
  1. if ($show_MYK_PAYPAL == true) {
That should be
PHP Syntax (Toggle Plain Text)
  1. if ($show_MYK_PAYPAL == "true") {
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PHP Includes Apache 1.3.33 and a Mac
Next Thread in PHP Forum Timeline: disable a textbox





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC