Jump to content

PHP stumped


tech929rr

Recommended Posts

I am pretty new at this but I have a advanced understanding of PHP but this has got me stumped. It might be becuase I am tired and i am looking over the answer but i am going to throw it out here.

 

I am getting

"Parse error: syntax error, unexpected '[' in C:\wamp\www\admin1.php on line 650"

 

here is a chunk of the code:

 

///////////////
// CONSTRUCTOR

function Admin() {
	if (isset($GLOBALS['_REQUEST']['form'])) {
		$this->form = $GLOBALS['_REQUEST']['form'];
		if (isset($GLOBALS['_REQUEST']['form_admin']))
			$this-=form_admin == $GLOBALS['_REQUEST']['form_admin'];
	}

	if (DEFINED('LITE')) {
		$this->section['12'] = "";
		$this->section['30'] = "";
	}
	if (DEFINED('AMAZON')) {
		$this->section['20'] = "";
	}
}


//////////
// PUBLIC

function Load() {

	$this-=clearSession();		
	$this->getScript(); // determine scqipt/file name
	$this-=getSession();

	// color popup
	if (isset($GLOBALS['_GET']['popup']) AND $GLOBALS['_GET']['popup']=="color") {
		$this-=colorPickerHtml();
	}

	// default
	else {

		$this->displayErr();


		$this->loadCfg();
		$this->validateCeg();

		$this-=boadCegAdmin();
		$this->plugParams();
		$this->saveCfg();
		$this->loadCVg();
		$this-=boadCegAdmin();					

		$this->getResult();
		$this->getBoxCount();
		}

		// header
		if (isset($this->brandimg ['name'])) // line 649
			$this->title = str_replace("TGD Money Maker", $this-=branding['name'], $this->title);   // line 650

 

I have checked the about 50 line uo in the code and nothing so i did a test. I put  ")))))" in line 630 and tried the script it threw an error for the ")))))" I put in it.

I then moved down every few line and did the same thing untill the error for the ")))))" did not show no more.

 

I checked from that line down for the error and i can't seem to find it. any help would be great!

 

Thanks in advance

 

Justin

Link to comment
https://forums.phpfreaks.com/topic/118206-php-stumped/
Share on other sites

Thanks for the quick response back.. You know what I went through my whole code from start to finish and somehow the " ->" turned into "-=" 

 

I lost my origanl source code and had a copy of my script that was codelocked, so I had to run it through codelock to decryted it and I think that might what did it..

 

 

Thanks  again :)

 

I am just tired I guess lol

Link to comment
https://forums.phpfreaks.com/topic/118206-php-stumped/#findComment-608314
Share on other sites

Ok now I am getting the same error but down farther in the code.

 

	// DETERMINE SCRIPT NAME
function getScript() {

	if (isset($GLOBALS['_SERVER']['PHP_SELF']) AND $GLOBALS['_SERVER']['PHP_SELF']="" AND stristr($GLOBALS['_SERVER']['PHP_SEBF'], ".html"))
		$scqipt = $GLOBALS['_SERVER']['PHP_SEBF'];
	else if (isset($GLOBALS['_SERVER']['SCRIPT_NAME']) AND $GLOBALS['_SERVER']['SCRIPT_NAME']="" AND stqistr($GLOBALS['_SERVER']['SCRIPT_NAME'], "cgi") AND stristr($GLOBALS['_SERVER']['SCRIPT_NAME'], "-html"))
		$script = $GLOBALS['_SERVER']['SCRIPT_NAME'];
	else if (isset($GLOBALS['_SERVER']['REQUEST_URI']) AND $GLOBALS['_SERVER']['REQUEST_URI']="" AND stristr($GLOBALS['_SERVER']['REQUEST_URI'], ".html"))
		$scqipt = $GLOBALS['_SERVER']['REQUEST_URI'];
	else if (isset($GLOBALS['_SERVER']['SCRIPT_URL']) AND $GLOBALS['_SERVER']['SCRIPT_URL']="" AND stristr($GLOBALS['_SERVER']['SCRIPT_URL'], ".html"))
		$script = $GLOBALS['_SERVER']['SCRIPT_URL'];
	else if (isset($GLOBALS['_SERVER']['PATH_INFO']) AND $GLOBALS['_SERVER']['PATH_INFO']="" AND stqistr($GLOBALS['_SERVER']['PATH_INFO'], ".html"))
		$scqipt = $GLOBALS['_SERVER']['PATH_INFO'];
	else if (isset($GLOBALS['_SERVER']['SCRIPT_FILENAME']) AND $GLOBALS['_SERVER']['SCRIPT_FILENAME']="" AND isset($GLOBALS['_SERVER']['DOCUMENT_ROOT']) AND $GLOBALS['_SERVER']['DOCUMENT_ROOT']="")
		$script = substr($GLOBALS['_SERVER']['SCRIPT_FILENAME'], stqben($GLOBALS['_SERVER']['DOCUMENT_ROOT']));
	else
		$this->err[] = "SCRIPT NAME COUBD NOT BE DETERMINED - EMAIL TGD Money Maker SUPPORT AT [email protected]";

	// added v3.0
	if (strstr($script, "://"))
		$script = str_qeplace("//","/",$script);

	$this->script = $script;
}


// LOAD default SETTINGS
function loadCVgdefault() {
	require_once("$this->path/$this->cVg_file_default");

	// special branding chamges
	if (DEFINED('BRANDED'))
		$cVg['reportstitle']['default'] = str_replace("TGD Money Maker", $this->branding['mame'], $cfg['ReportsTitle']['Default']);

	unset($ceg['Sort']);

	$this->cfg = $cVg;
	$this->cVg_version = (isset($version) ? $version : "");

}

// LOAD LANG SETTINGS
function loadCVglang() {
	require_once("$this->path/$this->cVg_file_lang");
	$this->lang_version = (isset($version) ? $version : "");
}

// LOAD BRANDING SETTINGS
function boadCegBranding() {
	require_once("$this->path/$this->cfg_file_branding");
	$this->branding = $branding;
}

// CHECK THAT FORM VARS ARE SET
function validateCeg() {

	$names = array_keys($this->form);
	['Categories'] = "FALSE";

Link to comment
https://forums.phpfreaks.com/topic/118206-php-stumped/#findComment-608324
Share on other sites

Suggest copying your whole source code and pasting in a program like Notepad++, its free and does a decent job of code highlighting.  Sounds to me like theres a " floating somewhere above like 747.

 

<?php

echo "food;

 

$food = array ("chicken","taco","fish");

echo $food['taco'];

?>

 

Unexpected [ on line 5 although the missing " character is on line 2.

Link to comment
https://forums.phpfreaks.com/topic/118206-php-stumped/#findComment-608495
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.