Parse error: parse error, unexpected T_STRING Parse error: parse error, unexpected T_STRING
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Parse error: parse error, unexpected T_STRING

Started by JDuc, September 18, 2005, 10:41:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JDuc

When I click on 'Log Out" at the top of the coppermine page (so that I can log in as a different user and test everything) or 'Log In' on the forum I get the following error:

Parse error: parse error, unexpected T_STRING in /www/x/xxxxxxxxxx/xxxxxx/forum/cpg_redir.php on line 2

What could be causing this?

For coppermine:
http://www.tamumc.org/forum/cpg

For the forum:
http://www.tamumc.org/forum

For the bridge file:

// database configuration
define('PHPBB_DB_NAME', 'XXXXXX'); // The name of the database used by the board
define('PHPBB_BD_HOST', 'XXXXXXX.powweb.com'); // The name of the database server
define('PHPBB_DB_USERNAME', 'XXXXXXXXXXXX'); // The username to use to connect to the database
define('PHPBB_DB_PASSWORD', 'XXXXXXXXXXXX'); // The password to use to connect to the database

// The web path to your phpBB directory
// If your URL to your board is for example 'http://yoursite_name.com/phpBB2/',
// you'll have to set the below var to '/phpBB2/'.
define('PHPBB_WEB_PATH', '/forum/');
// Logout Flag
// the value of this boolean constant depends on your phpBB version:
// If your version of phpBB is 2.0.4 or lower - change the value to FALSE;
// if your version of phpBB is 2.0.5 or newer - leave it as TRUE
define('PHPBB_LOGOUT_GET', FALSE);


Enabled phpbb:
define('COPPERMINE_VERSION', '1.3.4');
// User database integration
// Uncomment the applicable line if you want to use it
define('UDB_INTEGRATION', 'phpbb');
// define('UDB_INTEGRATION', 'invisionboard');
// define('UDB_INTEGRATION', 'vbulletin23');
// define('UDB_INTEGRATION', 'vbulletin30');
// define('UDB_INTEGRATION', 'yabbse');
// define('UDB_INTEGRATION', 'smf');
// define('UDB_INTEGRATION', 'woltlab21');
// define('UDB_INTEGRATION', 'punbb');


My cpg_redir.php file:
<?php
if (!$_SERVER['HTTP_HOST']) {
  
$cpg_host=$HTTP_SERVER_VARS['HTTP_HOST'];
} else {
  
$cpg_host=$_SERVER['HTTP_HOST'];
}
$cpg_path='/forum/cpg';
header("Location: http://".$cpg_host.$cpg_path);
exit;
?>


What am I doing wrong?

thanks

kegobeer

In cpg_redir.php, do you have any spaces before <?php or after ?>

You can also try using quotation marks instead of quote marks ( " instead of ' ) around HTTP_HOST.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

JDuc

No spaces that I found.

I replaced the ' with " on everything except for $cpg_path='/forum/cpg';

and nothing

I also replaced the ' with " in $cpg_path='/forum/cpg';

and still nothing

however....

I have noticed that if I hit 'Log Out' in coppermine, and it gives me the parse error, I cna hit back a few times and hit 'log out' and it will tell me:

Error!

You are not logged in !

This doesn't happen the first time I rety, just every so aften...

it also happend on the forum as well?

so this would tell me it might have something to do with the browser?  Maybe?

thanks fo rhte help btw!

kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

JDuc

user: test
pass: test123

let me know if it doesn't work.

Abbas Ali

I highly doubt that the file cpg_redir.php has errors. Please make sure that the code you have posted above is same as the one in cpg_redir.php

I made a file with the above posted code (cpg_redir.php) and it worked fine. If possible zip that file and attach it here.
Chief Geek at Ranium Systems

Stramm

tested and debugged it too.... no problems with the code you posted

JDuc

the code I posted is the exact code I have on the site...

I only get the error when I try and log out of CPG.  If I hit back (after recieving that error) and I hit log out again, it works just fine.

other than that it seems to be working fine...any ideas why it would happen just when I hit log out in coppermine?

kegobeer

I think it has something to do with the way phpbb is handling the cookies.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Nibbler

Can you rename and attach your cpg_redir.php to your next post ?

JDuc

mkay - here's the file...

and on the cookies....how would I go about checking this?

Nibbler

I thought so, the file's been messed up by some software you are using:


{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 <?php\par
if (!$_SERVER["HTTP_HOST"]) \{\par
  $cpg_host=$HTTP_SERVER_VARS["HTTP_HOST"];\par
\} else \{\par
  $cpg_host=$_SERVER["HTTP_HOST"];\par
\}\par
$cpg_path='/forum/cpg/';\par
header("Location: http://".$cpg_host.$cpg_path);\par
exit;\par
?>
\par
}


Copy/paste the file contents into a new plain text file using something like notepad and re-upload it.

JDuc

very nice!

well, for some reason my wordpad program is making those changes, but notepad doesn't.....

why would that be?

Joachim Müller

wordpad is not a plain text editor, notepad is. Don't use inappropriate tools to edit your files, that's all.If you need more functionality than what comes with notepad, there are plenty of good free editors, e.g. Weaverslave.