Jump to content

Recommended Posts

I have the following code:

 

class paypal_class {

private $ipn_status;                // holds the last status
public $admin_mail; 	// receive the ipn status report pre transaction
public $paypal_mail;	// paypal account, if set, class need to verify receiver
public $txn_id;		// array: if the txn_id array existed, class need to verified the txn_id duplicate
public $ipn_log;                    // bool: log IPN results to text file?
private $ipn_response;              // holds the IPN response from paypal   
public $ipn_data = array();         // array contains the POST values for IPN
private $fields = array();          // array holds the fields to submit to paypal
private $ipn_debug; 				// ipn_debug

// initialization constructor.  Called when class is created.
function __construct() { 
etc...

 

Howerver, I'm getting the error Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' on Line 3

 

Any ideas as to why this may be? It's a Paypal IPN script that I downloaded and looking at the responses it received seemed to work fine for everyone else.

 

Thanks for your help.

Link to comment
https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/
Share on other sites

The PHP 4 way to define class properties is to use the var keyword. So something like this:

 

class paypal_class {

var $ipn_status;                // holds the last status
var $admin_mail; 	// receive the ipn status report pre transaction
var $paypal_mail;
...

 

But because this class was apparently developed for PHP 5 there's a good chance you'll run into other compatibility issues as well.

The end of life and end of support for php4 was over two and a half years ago. Your web host should have provided a way of upgrading to php5, either through your web hosting control panel or through a setting in a .htaccess file...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.