mattspriggs28 Posted July 28, 2010 Share Posted July 28, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/ Share on other sites More sharing options...
Alex Posted July 28, 2010 Share Posted July 28, 2010 Your problem may be that you're running on PHP 4 which does not support the visibility keywords public/private/protected. To see what version of PHP you're running create a new file and place this inside: <?php phpinfo(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/#findComment-1092097 Share on other sites More sharing options...
mattspriggs28 Posted July 28, 2010 Author Share Posted July 28, 2010 I had a feeling it may have been something to do with the version I'm using. And yes, it's version 4. Is there a workaround for this within version 4? Quote Link to comment https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/#findComment-1092099 Share on other sites More sharing options...
Alex Posted July 28, 2010 Share Posted July 28, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/#findComment-1092101 Share on other sites More sharing options...
PFMaBiSmAd Posted July 28, 2010 Share Posted July 28, 2010 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... Quote Link to comment https://forums.phpfreaks.com/topic/209107-error-but-not-sure-why/#findComment-1092104 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.