Parse error: syntax error, unexpected T_OBJECT_OPERATOR
Posted: Wed Aug 20, 2008 10:30 pm
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in line 89
I am just in the process of learning OOP PHP 5.
The error is in the foreach. I am probably doing something wrong with the start. It works when I write is procedurally. I'm sure this is a
syntax issue
Related issue is when should I use $this->variable and just $variable in a method.
I am just in the process of learning OOP PHP 5.
The error is in the foreach. I am probably doing something wrong with the start. It works when I write is procedurally. I'm sure this is a
syntax issue
Related issue is when should I use $this->variable and just $variable in a method.
Code: Select all
public function sendTransaction()
{
//Note below is lin 89
foreach(this->$authnet_values as $key => $value )
$this->fields .= "$key=" . urlencode( $value ) . "&";
$this->ch = curl_init($this->auth_net_url);
curl_setopt($this->ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($this->ch, CURLOPT_POSTFIELDS, rtrim( $this->fields, "& " )); // use HTTP POST to send form data
### curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. ###
$this->resp = curl_exec($this->ch); //execute post and get results
curl_close ($this->ch);
}