Hi there;
I was wondering if someone could help me please.
I just installed Authorize.net AIM and have all the settings set.
But when I run a test order, after clicking Confirm Order, I receive this error :
Parse error: syntax error, unexpected T_VARIABLE in /home/content/l/a/d/ladykdelights/html/catalog/checkout_process.php on line 56
Here is the surrounding code snippet :
// load the selected shipping module
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping($shipping);
require(DIR_WS_CLASSES . 'order.php');
$order = new order;
require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;
$order_totals = $order_total_modules->process();
// load the before_process function from the payment
modules
$payment_modules->before_process(); (line 56)
$sql_data_array = array('customers_id' => $customer_id,
'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
'customers_company' => $order->customer['company'],
'customers_street_address' => $order->customer['street_address'],
Can anyone see where the error is coming from?
Thanks for your help
Latest News: (loading..)
Parse error: syntax error, unexpected T_VARIABLE
Started by ladykaren, Mar 27 2011, 15:51
4 replies to this topic
#1
Posted 27 March 2011, 15:51
#2
Posted 27 March 2011, 17:11
// load the before_process function from the payment modules
If that code is actually on two lines (instead of one) in the PHP source - there's the problem.
Should be on ONE line.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#3
Posted 28 March 2011, 12:10
Hi germ;
Thanks so much for getting back. I moved modules up to the first line. That took care of that problem.
Now if I run a test order, after clicking confirm, I get this -
Warning: Cannot modify header information - headers already sent by (output started at /home/content/l/a/d/ladykdelights/html/catalog/includes/modules/payment/authorizenet_aim.php:921) in /home/content/l/a/d/ladykdelights/html/catalog/includes/functions/general.php on line 33
Here is snippet of code for catalog/includes/function/general.php
// Redirect to another page or site
function tep_redirect($url) {
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
}
header('Location: ' . $url); (line 33)
tep_exit();
}
////
// Parse the data used in the html tags to ensure the tags will not break
function tep_parse_input_field_data($data, $parse) {
return strtr(trim($data), $parse);
}
function tep_output_string($string, $translate = false, $protected = false) {
if ($protected == true) {
return htmlspecialchars($string);
} else {
if ($translate == false) {
return tep_parse_input_field_data($string, array('"' => '"'));
} else {
return tep_parse_input_field_data($string, $translate);
}
}
}
Help again please
Thanks so much
Thanks so much for getting back. I moved modules up to the first line. That took care of that problem.
Now if I run a test order, after clicking confirm, I get this -
Warning: Cannot modify header information - headers already sent by (output started at /home/content/l/a/d/ladykdelights/html/catalog/includes/modules/payment/authorizenet_aim.php:921) in /home/content/l/a/d/ladykdelights/html/catalog/includes/functions/general.php on line 33
Here is snippet of code for catalog/includes/function/general.php
// Redirect to another page or site
function tep_redirect($url) {
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url
$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL
}
}
header('Location: ' . $url); (line 33)
tep_exit();
}
////
// Parse the data used in the html tags to ensure the tags will not break
function tep_parse_input_field_data($data, $parse) {
return strtr(trim($data), $parse);
}
function tep_output_string($string, $translate = false, $protected = false) {
if ($protected == true) {
return htmlspecialchars($string);
} else {
if ($translate == false) {
return tep_parse_input_field_data($string, array('"' => '"'));
} else {
return tep_parse_input_field_data($string, $translate);
}
}
}
Help again please
Thanks so much
#4
Posted 28 March 2011, 12:50
Hi again;
I found it. There was a couple of white spaces at the bottom of the authorize.net_php file.
YIPPIE the test order worked lol
I found it. There was a couple of white spaces at the bottom of the authorize.net_php file.
YIPPIE the test order worked lol
#5
Posted 29 March 2011, 03:36
Glad you fixed it.
When you get the infamous "headers already sent" message the problem is in the first file mentioned in the error message.
When you get the infamous "headers already sent" message the problem is in the first file mentioned in the error message.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >














