/    Sign up×
Community /Pin to ProfileBookmark

Error message

Getting error in script:

Parse error: parse error, unexpected T_FUNCTION

Can anyone see where it may originate?

<?php

/* Database */
define(‘DB_USERNAME’, ‘back9pro_media’);
define(‘DB_PASSWORD’, ‘123456’);
define(‘DB_NAME’, ‘back9pro_media’);
define(‘DB_HOST’, ‘localhost’);

function checkTrail($dir)
{
if (substr($dir, -1) != “/”) {

$dir .= “/”;
}

return $dir;

}
/* Paths */
define(‘DOMAIN’, ‘http://www.back9proshop.com‘);
define(‘REL_ROOT’, ‘/’);
define(‘DOC_ROOT’, checkTrail(dirname(__FILE__)));
define(‘DESIGN_CSS’, REL_ROOT . ‘skin/default/css/’);
define(‘SMARTY_DIR’, DOC_ROOT . ‘libs/smarty/’);
define(‘PHPTHUMB_DIR’, DOC_ROOT . ‘libs/phpthumb/’);
define(‘SIMPLEPIE_DIR’, DOC_ROOT . ‘libs/simplepie/’);
define(‘MAGICPIE_DIR’, DOC_ROOT . ‘libs/magpierss/’);
define(‘INCLUDES_MAIN’, DOC_ROOT . ‘includes/’);
define(‘INCLUDES_FRONT’, DOC_ROOT . ‘includes/display/’);
define(‘INCLUDES_ADMIN’, DOC_ROOT . ‘includes/admin/’);
define(‘INCLUDES_COMMON’, DOC_ROOT . ‘includes/common/’);
define(‘ADMIN_TEMPLATES_DIR’, DOC_ROOT . ‘adm/templates/’);
define(‘ADMIN_CTEMPLATES_DIR’, DOC_ROOT . ‘adm/templates_c/’); // Must be CHMOD 777
define(‘FRONT_TEMPLATES_DIR’, DOC_ROOT . ‘templates/’);
define(‘FRONT_CTEMPLATES_DIR’, DOC_ROOT . ‘templates_c/’); // Must be CHMOD 777
define(‘IMAGES_DIR’, DOC_ROOT . ‘imgs/’);
define(‘FILES_DIR’, DOC_ROOT . ‘files/’);
define(‘MAIL_DIR’, DOC_ROOT . ‘libs/swiftmailer/’);

$path = DOC_ROOT . ‘libs/PEAR’ . PATH_SEPARATOR .
DOC_ROOT . ‘libs/PEAR/DB’ . PATH_SEPARATOR .
DOC_ROOT . ‘libs/’ . PATH_SEPARATOR .
INCLUDES_MAIN . PATH_SEPARATOR .
INCLUDES_COMMON . PATH_SEPARATOR;

set_include_path(get_include_path() . PATH_SEPARATOR . $path);
include_once (DOC_ROOT . ‘includes/common/functions.php’);
@include_once (DOC_ROOT . ‘semiconfig.php’);
ini_set(‘session.save_path’, DOC_ROOT . ‘cache’); // Must be CHMOD 777
session_start();
?>

to post a comment
PHP

15 Comments(s)

Copy linkTweet thisAlerts:
@bokehAug 18.2007 — It's a parse error in one of the included files.
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — "included" meaning files within

'includes/admin/'

'includes/common/' ...and so on

or some other file included somewhere within the entire script?
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — If you bother to read the complete error message it will tell you which file contains the error and on which line the parser believes the error to be.
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — Yes it is the file I provided at about line 22 or 23 depending on alterations,

but it seems that the line pointed to may not be where the exact error is because I can remove the line completely and still get the error.
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — Post the file!
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — <?php

/* Database */

define('DB_USERNAME', 'back9pro_media');

define('DB_PASSWORD', '123456');

define('DB_NAME', 'back9pro_media');

define('DB_HOST', 'localhost');

function checkTrail($dir)

{

if (substr($dir, -1) != "/") {

$dir .= "/";
}

return $dir;

}

/* Paths */

define('DOMAIN', 'http://www.back9proshop.com');

define('REL_ROOT', '/');

define('DOC_ROOT', checkTrail(dirname(__FILE__)));

define('DESIGN_CSS', REL_ROOT . 'skin/default/css/');

define('SMARTY_DIR', DOC_ROOT . 'libs/smarty/');

define('PHPTHUMB_DIR', DOC_ROOT . 'libs/phpthumb/');

define('SIMPLEPIE_DIR', DOC_ROOT . 'libs/simplepie/');

define('MAGICPIE_DIR', DOC_ROOT . 'libs/magpierss/');

define('INCLUDES_MAIN', DOC_ROOT . 'includes/');

define('INCLUDES_FRONT', DOC_ROOT . 'includes/display/');

define('INCLUDES_ADMIN', DOC_ROOT . 'includes/admin/');

define('INCLUDES_COMMON', DOC_ROOT . 'includes/common/');

define('ADMIN_TEMPLATES_DIR', DOC_ROOT . 'adm/templates/');

define('ADMIN_CTEMPLATES_DIR', DOC_ROOT . 'adm/templates_c/'); // Must be CHMOD 777

define('FRONT_TEMPLATES_DIR', DOC_ROOT . 'templates/');

define('FRONT_CTEMPLATES_DIR', DOC_ROOT . 'templates_c/'); // Must be CHMOD 777

define('IMAGES_DIR', DOC_ROOT . 'imgs/');

define('FILES_DIR', DOC_ROOT . 'files/');

define('MAIL_DIR', DOC_ROOT . 'libs/swiftmailer/');

$path = DOC_ROOT . 'libs/PEAR' . PATH_SEPARATOR .

DOC_ROOT . 'libs/PEAR/DB' . PATH_SEPARATOR .

DOC_ROOT . 'libs/' . PATH_SEPARATOR .

INCLUDES_MAIN . PATH_SEPARATOR .

INCLUDES_COMMON . PATH_SEPARATOR;

set_include_path(get_include_path() . PATH_SEPARATOR . $path);

include_once (DOC_ROOT . 'includes/common/functions.php');

@include_once (DOC_ROOT . 'semiconfig.php');

ini_set('session.save_path', DOC_ROOT . 'cache'); // Must be CHMOD 777

session_start();

?>
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — Oh dear! That's the file you already posted above. Post the file that contains the error. And when you post code in the forum use PHP code tags... [B]&#91;PHP]&#91;/PHP][/B]
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — That is the file that everything says contains the error.

I've run this file through two independent syntax checking sources and I get the very same error.
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — There's no parse error in that file. Post the complete error message.
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — Well here is the server altered version of the file.

[code=php]

<?php
//define('EMAIL', '*email*');

/* Database */
define('DB_USERNAME', 'ddddddd');
define('DB_PASSWORD', 'sssss');
define('DB_NAME', 'lllllllll');
define('DB_HOST', 'localhost');

function checkTrail($dir)
{
if (substr($dir, -1) != "/") {

$dir .= "/";
}

return $dir;
}
/* Paths */
define('DOMAIN', 'http://www.xyz.com');
define('REL_ROOT', '/xxx/');
define('REG_KEY', '<br />');
<b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'phppodc'@'localhost' (using password: YES) in <b>/home/phppodc/public_html/check.php</b> on line <b>25</b><br />
Not connected : Access denied for user 'phppodc'@'localhost' (using password: YES)');
define('DOC_ROOT', checkTrail(dirname(__FILE__)));
define('DESIGN_CSS', REL_ROOT . 'skin/default/css/');
define('SMARTY_DIR', DOC_ROOT . 'libs/smarty/');
define('PHPTHUMB_DIR', DOC_ROOT . 'libs/phpthumb/');
define('SIMPLEPIE_DIR', DOC_ROOT . 'libs/simplepie/');
define('MAGICPIE_DIR', DOC_ROOT . 'libs/magpierss/');
define('INCLUDES_MAIN', DOC_ROOT . 'includes/');
define('INCLUDES_FRONT', DOC_ROOT . 'includes/display/');
define('INCLUDES_ADMIN', DOC_ROOT . 'includes/admin/');
define('INCLUDES_COMMON', DOC_ROOT . 'includes/common/');
define('ADMIN_TEMPLATES_DIR', DOC_ROOT . 'adm/templates/');
define('ADMIN_CTEMPLATES_DIR', DOC_ROOT . 'adm/templates_c/'); // Must be CHMOD 777
define('FRONT_TEMPLATES_DIR', DOC_ROOT . 'templates/');
define('FRONT_CTEMPLATES_DIR', DOC_ROOT . 'templates_c/'); // Must be CHMOD 777
define('IMAGES_DIR', DOC_ROOT . 'imgs/');
define('FILES_DIR', DOC_ROOT . 'files/');
define('MAIL_DIR', DOC_ROOT . 'libs/swiftmailer/');

$path = DOC_ROOT . 'libs/PEAR' . PATH_SEPARATOR .
DOC_ROOT . 'libs/PEAR/DB' . PATH_SEPARATOR .
DOC_ROOT . 'libs/' . PATH_SEPARATOR .
INCLUDES_MAIN . PATH_SEPARATOR .
INCLUDES_COMMON . PATH_SEPARATOR;

set_include_path(get_include_path() . PATH_SEPARATOR . $path);
include_once (DOC_ROOT . 'includes/common/functions.php');
@include_once (DOC_ROOT . 'semiconfig.php');
ini_set('session.save_path', DOC_ROOT . 'cache'); // Must be CHMOD 777
session_start();
?>

[/code]



and this is the error from script check

Parse error: parse error, unexpected '<' in config.php on line 23
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — [CODE]<?php
//define('EMAIL', '*email*');

/* Database */
define('DB_USERNAME', 'ddddddd');
define('DB_PASSWORD', 'sssss');
define('DB_NAME', 'lllllllll');
define('DB_HOST', 'localhost');

function checkTrail($dir)
{
if (substr($dir, -1) != "/") {

$dir .= "/";
}

return $dir;
}
/* Paths */
define('DOMAIN', 'http://www.xyz.com');
define('REL_ROOT', '/xxx/');
define('REG_KEY', '<br />');
[COLOR="Red"][B]<b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'phppodc'@'localhost' (using password: YES) in <b>/home/phppodc/public_html/check.php</b> on line <b>25</b><br />
Not connected : Access denied for user 'phppodc'@'localhost' (using password: YES)');[/B][/COLOR]
define('DOC_ROOT', checkTrail(dirname(__FILE__)));
define('DESIGN_CSS', REL_ROOT . 'skin/default/css/');
define('SMARTY_DIR', DOC_ROOT . 'libs/smarty/');
define('PHPTHUMB_DIR', DOC_ROOT . 'libs/phpthumb/');
define('SIMPLEPIE_DIR', DOC_ROOT . 'libs/simplepie/');
define('MAGICPIE_DIR', DOC_ROOT . 'libs/magpierss/');
define('INCLUDES_MAIN', DOC_ROOT . 'includes/');
define('INCLUDES_FRONT', DOC_ROOT . 'includes/display/');
define('INCLUDES_ADMIN', DOC_ROOT . 'includes/admin/');
define('INCLUDES_COMMON', DOC_ROOT . 'includes/common/');
define('ADMIN_TEMPLATES_DIR', DOC_ROOT . 'adm/templates/');
define('ADMIN_CTEMPLATES_DIR', DOC_ROOT . 'adm/templates_c/'); // Must be CHMOD 777
define('FRONT_TEMPLATES_DIR', DOC_ROOT . 'templates/');
define('FRONT_CTEMPLATES_DIR', DOC_ROOT . 'templates_c/'); // Must be CHMOD 777
define('IMAGES_DIR', DOC_ROOT . 'imgs/');
define('FILES_DIR', DOC_ROOT . 'files/');
define('MAIL_DIR', DOC_ROOT . 'libs/swiftmailer/');

$path = DOC_ROOT . 'libs/PEAR' . PATH_SEPARATOR .
DOC_ROOT . 'libs/PEAR/DB' . PATH_SEPARATOR .
DOC_ROOT . 'libs/' . PATH_SEPARATOR .
INCLUDES_MAIN . PATH_SEPARATOR .
INCLUDES_COMMON . PATH_SEPARATOR;

set_include_path(get_include_path() . PATH_SEPARATOR . $path);
include_once (DOC_ROOT . 'includes/common/functions.php');
@include_once (DOC_ROOT . 'semiconfig.php');
ini_set('session.save_path', DOC_ROOT . 'cache'); // Must be CHMOD 777
session_start();
?> [/CODE]
What's that doing there?
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — I believe it's the way the script creator implemented so that whenever the file is accessed by the server that the script can be validated as legitimately purchased.
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — I believe it's the way the script creator implemented so that whenever the file is accessed by the server that the script can be validated as legitimately purchased.[/QUOTE]It's the error.
Copy linkTweet thisAlerts:
@xerxesx1authorAug 18.2007 — OK, I agree. Do you see anything in the syntax of it that I may be able to alter to make it work.
Copy linkTweet thisAlerts:
@bokehAug 18.2007 — Do you see anything in the syntax of it that I may be able to alter to make it work.[/QUOTE]Removal would be a good start.
×

Success!

Help @xerxesx1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...