coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 (BBS) Integration / Bridging => Topic started by: JDuc on September 18, 2005, 10:41:59 PM

Title: Parse error: parse error, unexpected T_STRING
Post by: JDuc on September 18, 2005, 10:41:59 PM
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
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: kegobeer on September 19, 2005, 12:58:36 AM
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.
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: JDuc on September 19, 2005, 01:25:53 AM
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!
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: kegobeer on September 19, 2005, 12:47:58 PM
Post a test user and password please.
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: JDuc on September 19, 2005, 02:16:36 PM
user: test
pass: test123

let me know if it doesn't work.
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: Abbas Ali on September 20, 2005, 09:17:46 AM
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.
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: Stramm on September 20, 2005, 10:19:15 AM
tested and debugged it too.... no problems with the code you posted
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: JDuc on September 20, 2005, 03:31:38 PM
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?
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: kegobeer on September 20, 2005, 05:09:22 PM
I think it has something to do with the way phpbb is handling the cookies.
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: Nibbler on September 20, 2005, 05:14:54 PM
Can you rename and attach your cpg_redir.php to your next post ?
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: JDuc on September 20, 2005, 05:39:53 PM
mkay - here's the file...

and on the cookies....how would I go about checking this?
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: Nibbler on September 20, 2005, 05:43:40 PM
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.
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: JDuc on September 20, 2005, 06:44:52 PM
very nice!

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

why would that be?
Title: Re: Parse error: parse error, unexpected T_STRING
Post by: Joachim Müller on September 20, 2005, 07:01:23 PM
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.