close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Parse error

Thread began 2/14/2010 10:30 pm by JMcKay400963 | Last modified 2/17/2010 8:39 pm by Dani Chankhour | 1058 views | 3 replies |

JMcKay400963

Parse error

I am new to PHP and this PowerStore but I can find my way around. I have been able to upload the Powerstore files to a test server and have progressed to the administration set up of the store. However at the top of the screen there is a Parse Error which is limiting the funcationality of the admin. I cannot add products, users, etc. Any help is greatly appreciated.

Parse error: parse error in C:\wamp\www\oaksteadmed\ecart\WA_Globals\WA_Globals.php(58) : eval()'d code on line 1

Here is the WA_Globals.php code:

<?php
//need to run installation wizard
if(!file_exists('../Connections/installed.txt') && (!file_exists('Connections/installed.txt'))) {
if(file_exists('../install/index.php')) {
header('Location: ../install/index.php');
} else {
header('Location: install/index.php');
}
exit();
}
?>
<?php
function replaceTokens($encodedVal,$Arr) {
$tokens = preg_match("/\\[([^\\]]*)\\]/",$encodedVal,$subMatch);
$retVal = $encodedVal;
if (sizeof($subMatch)>0) {
$ArrIndex = $subMatch[1];
$ArrPos = explode(":",$ArrIndex);
if (isset($Arr[$ArrPos[0]])) {
for ($x=0; $x<sizeof($Arr[$ArrPos[0]]); $x++) {
if ($Arr[$ArrPos[0]][$x][0] == $ArrPos[1]) {
$retVal = str_replace($subMatch[0],$Arr[$ArrPos[0]][$x][1],$retVal);
}
}
}
}
return $retVal;
}
?>
<?php
$thisDir = realpath(dirname(__FILE__));
if(strpos($thisDir,"/") !== false) {
$thisDir = substr($thisDir,0,strrpos($thisDir,"/"));
} else {
$thisDir = substr($thisDir,0,strrpos($thisDir,"\\"));
}
require_once($thisDir."/Connections/PowerStoreConnection.php");

mysql_select_db($database_PowerStoreConnection, $PowerStoreConnection);
$query_WAGlobals = "SELECT * FROM wa_settings";
$WAGlobals = mysql_query($query_WAGlobals, $PowerStoreConnection);
$row_WAGlobals = mysql_fetch_assoc($WAGlobals);

$tabs = array();
while ($row_WAGlobals) {
if ($row_WAGlobals['grp'] != "None") {
if (!isset($tabs[$row_WAGlobals['grp']])) {
$tabs[$row_WAGlobals['grp']] = array();
}
$tabs[$row_WAGlobals['grp']][] = array($row_WAGlobals['name'],$row_WAGlobals['value'],$row_WAGlobals['type'],$row_WAGlobals['options'],$row_WAGlobals['variable']);
}
$row_WAGlobals = mysql_fetch_assoc($WAGlobals);
}


foreach ($tabs as $key => $value) {
for ($x=0; $x<sizeof($value); $x++) {
eval("\$WAGLOBAL_".$value[$x][4]."='".replaceTokens($value[$x][1],$tabs)."';");
}
}

//root url
$WAGLOBAL_Root_URL = ((isset($_SERVER['SERVER_PROTOCOL']) && strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS') !== false) ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . $WAGLOBAL_localRoot;

mysql_free_result($WAGlobals);
?>

Sign in to reply to this post

Dani Chankhour

I'm assuming you have not changed this file.

But looking at where the error is generated, it might be that it is not finding the connection folder.

Are all the PowerStore files and folder under the ecart folder?

Sign in to reply to this post

JMcKay400963

Yes, all files and folders are located in the ecart folder

Sign in to reply to this post

Dani Chankhour

OK, Can you check if the database tables are created correctly? (specifically, look for a wa_settings table)

The line of code that is breaking, is trying to set global settings which is reading from the database.

Sign in to reply to this post

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...