View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Fatal Error: Function name must be a string

Thread began 8/25/2009 11:52 am by tom92909 | Last modified 9/15/2009 1:43 pm by tom92909 | 2822 views | 5 replies

tom92909Beta Tester

Fatal Error: Function name must be a string

Good morning! :)

I've created a new shopping cart using the new 4.5 eCart Extension. I've had v4 working in the past with no issues, but this is a brand new cart using the the new version.

On order confirmation, I'm getting the following error message;
Fatal error: Function name must be a string in /public_html/confirm.php on line 306

Line 306

php:
$WA_fieldValuesStr = "".session_id()  ."" . "|" . "".((isset($_POST["email"]))?$_POST["email"]:"")  ."" . "|" . WA_eCDB_ConvertNumber("".$eCart1->GetShipping()  ."") . "|" . WA_eCDB_ConvertNumber("".$eCart1->GetTax()  ."") . "|" . WA_eCDB_ConvertNumber("".$eCart1->GrandTotal()  ."") . "|" . "".$date(m/d/Y)  ."" . "|" . "".((isset($_POST["firstname"]))?$_POST["firstname"]:"")  ." ".((isset($_POST["lastname"]))?$_POST["lastname"]:"")  ."" . "|" . "".((isset($_SERVER["REMOTE_ADDR"]))?$_SERVER["REMOTE_ADDR"]:"")  ."";




I have Dreamweaver CS3.
I am using Apache, Linux PHP, and MySQL.
I have probably 7 other domains with functional v4 carts (not v.4.5)

I am populating both Order and OrderDetail tables when the transaction is completed.

confirm.php - Lines 297 thur 357:

php:
<?php 

// WA eCart Store Cart Summary in Db
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) // Trigger
{
  
$WA_connection $ba;
  
$WA_table "orders";
  
$WA_redirectURL "";
  
$WA_indexField "OrderID";
  
$WA_fieldNamesStr "OrderReferenceID|OrderUserID|OrderShipping|OrderTax|OrderTotal|OrderDate|OrderUserName|ip_address";
  
$WA_fieldValuesStr "".session_id()  ."" "|" "".((isset($_POST["email"]))?$_POST["email"]:"")  ."" "|" WA_eCDB_ConvertNumber("".$eCart1->GetShipping()  ."") . "|" WA_eCDB_ConvertNumber("".$eCart1->GetTax()  ."") . "|" WA_eCDB_ConvertNumber("".$eCart1->GrandTotal()  ."") . "|" "".$date(m/d/Y)  ."" "|" "".((isset($_POST["firstname"]))?$_POST["firstname"]:"")  ." ".((isset($_POST["lastname"]))?$_POST["lastname"]:"")  ."" "|" "".((isset($_SERVER["REMOTE_ADDR"]))?$_SERVER["REMOTE_ADDR"]:"")  ."";
  
$WA_columnTypesStr "',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NULL|',none,''|',none,''|',none,''";
  
$WA_sessionName "eCart1_OrderID";
  
$WA_Sql "";
  
$NeedInsert false;
  
$indexFieldIndex = -1;
  
$WA_fieldValues explode("|"$WA_fieldValuesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  
$WA_connectionDB $database_ba;
  
$updateFieldValue "";
  
mysql_select_db($WA_connectionDB$WA_connection);
  if (!
session_id()) session_start();
  if (
$WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
    
$WA_redirectURL .= ((strpos('?'$WA_redirectURL) === false)?"?":"&").$_SERVER["QUERY_STRING"];
  }
  
$WA_fieldNames explode("|"$WA_fieldNamesStr);
  
$WA_columns explode("|"$WA_columnTypesStr);
  for (
$i 0$i sizeof($WA_fieldNames); $i++)
  {
    if (
$WA_indexField  == $WA_fieldNames[$i])
    {
      
$indexFieldIndex $i;
      break;
    }
  }
  
$deleteFieldValue "";
  
$updateColType "none,none,NULL";
  if (
$indexFieldIndex >= 0$updateFieldValue $WA_fieldValues[$indexFieldIndex];
  if (
$updateFieldValue == "" && isset($_SESSION[$WA_sessionName])) $updateFieldValue $_SESSION[$WA_sessionName];
  if (
$indexFieldIndex >= 0$updateColType $WA_columns[$indexFieldIndex];
  if (
$updateFieldValue != "")     {
    
$updateParamsObj WA_generateInsertParams($WA_fieldNames$WA_columns$WA_fieldValues$indexFieldIndex);
    
$valueForWhere WA_generateInsertParams(array($WA_indexField), array($updateColType), array($updateFieldValue), -1);
    
$WA_Sql "update " $WA_table " SET " $updateParamsObj->WA_setValues " where " $WA_indexField " = " $valueForWhere->WA_dbValues;
    
$WA_editCmd mysql_query($WA_Sql$WA_connection) or die(mysql_error());
    
$_SESSION[$WA_sessionName] = $updateFieldValue;
    
$result mysql_query("SELECT * FROM " $WA_table " where " $WA_indexField " = " $valueForWhere->WA_dbValues$WA_connection);
    
$num_rows mysql_num_rows($result);
    
$NeedInsert = (mysql_num_rows($result) === 0);
  }
  if (
$updateFieldValue === "" || $NeedInsert)  {
    
$updateFieldValue "";
    
$insertParamsObj WA_generateInsertParams($WA_fieldNames$WA_columns$WA_fieldValues, -1);
    
$WA_Sql "insert into " $WA_table " (" $insertParamsObj->WA_tableValues ") values (" $insertParamsObj->WA_dbValues ")";
    
$WA_editCmd mysql_query($WA_Sql$WA_connection) or die(mysql_error());
    
$_SESSION[$WA_sessionName] = mysql_insert_id();
  }
  if (
$WA_redirectURL != "")  {
    
header("Location: ".$WA_redirectURL); exit;
  }
}
?>



Any suggestions?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...