Hello,

Parse error: syntax error, unexpected T_WHILE in /www/gamerscafe.nl/testing/www/portal/block/multiplay.php on line 35

got that error with the next code:

<?php
/*
*
* @name blank_block.php
* @package phpBB3 Portal XL 5.0
* @version $Id: blank_block.php,v 1.2 2009/05/15 22:32:06 damysterious Exp $
*
* @copyright (c) 2007, 2009 Portal XL Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}

/**
*/

/*
* Start session management
*/

/*
* Begin block script here
*/


if ($user->data['is_registered']){
$dat = $user->data['user_id'];
$link = '<iframe src ="http://www.come2play.com/channel_auth.asp?channel_id=33202&uid=';;
$link .= $dat;
$link .= '&nick_name=';
$result = mysql_query('SELECT * FROM '. USERS_TABLE .' WHERE user_id="$dat" ')
while($row = mysql_fetch_array( $result ))
{
$link .= $row ['username'];
}
$link .='&auth_sig=';
$channel = '23b7f054e101a14674b51c9f0d7dfee2';
$combine = $dat|$channel;
$combimix= md5($combine);
$link .= $combimix ;
$link .='" width="850" height="520" frameborder="0" scrolling="no" allowtransparency="true" >';
$link .='<p>Your browser does not support iframes.</p>';
$link .='</iframe>';
}else{
link. = '<center> You need to be logd in to see this iframe';
}


// Set the filename of the template you want to use for this file.
$template->set_filenames(array(
'body' => 'portal/block/multiplay.html',
));

?>

somebody has an idea?
; op regel 34 toevoegen aan einde
$result = mysql_query('SELECT * FROM '. USERS_TABLE .' WHERE user_id="$dat" ')

Dit klopt ook niet helemaal.. kijk ook maar naar de kleuren:)

Found the problems:

<?php
/*


*/
if (!defined('IN_PHPBB'))
{
exit;
}

if ($user->data['is_registered']){
$dat = $user->data['user_id'];
$link = '<iframe src ="http://www.come2play.com/channel_auth.asp?channel_id=33202&uid=';;
$link .= $dat;
$link .= '&nick_name=';
$result = mysql_query('SELECT * FROM '. USERS_TABLE .' WHERE user_id="$dat" ') ;
while($row = mysql_fetch_array( $result ))
{
$link .= $row ['username'];
}
$link .='&auth_sig=';
$channel = '23b7f054e101a14674b51c9f0d7dfee2';
$combine = $dat|$channel;
$combimix= md5($combine);
$link .= $combimix ;
$link .='" width="850" height="520" frameborder="0" scrolling="no" allowtransparency="true" >';
$link .='<p>Your browser does not support iframes.</p>';
$link .='</iframe>';
}else{
$link .= '<center> You need to be logd in to see this iframe';
}


// Set the filename of the template you want to use for this file.
$template->set_filenames(array(
'body' => 'portal/block/multiplay.html',
));

?>

Now i need the html to get it all out.

cheerz

Yeah rigth:) line 16 was the problem:)
trouwens het kan allemaal in nederlands toch... ben engels zo gewend :(

weet iemand een manier om de links eruit te krijgen in html? of kan ik dit zo gebruiken in mijn portal? want dan krijg ik errors:

[phpBB Debug] PHP Notice: in file /portal/block/multiplay.php on line 16: mysql_query() [function.mysql-query]: Access denied for user 'root'@'localhost' (using password: NO)
[phpBB Debug] PHP Notice: in file /portal/block/multiplay.php on line 16: mysql_query() [function.mysql-query]: A link to the server could not be established
[phpBB Debug] PHP Notice: in file /portal/block/multiplay.php on line 17: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4652: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3705)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4654: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3705)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4655: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3705)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4656: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3705)

ik snap de root@localhost niet.
want ik gebruik geen root.


En wat is je code tot nu toe? Je mag inderdaad alles in het nederlands op dit forum zetten.
De code die ik nu heb is:

<?php
/*


*/
if (!defined('IN_PHPBB'))
{
exit;
}


if ($user->data['is_registered']){
$dat = $user->data['user_id'];
$link = '<iframe src ="http://www.come2play.com/channel_auth.asp?channel_id=33202&uid=';;
$link .= $dat;
$link .= '&nick_name=';
$result = mysql_query('SELECT * FROM '. USERS_TABLE .' WHERE user_id="$dat" ') ;
while($row = mysql_fetch_array( $result ))
{
$link .= $row ['username'];
}
$link .='&auth_sig=';
$channel = '23b7f054e101a14674b51c9f0d7dfee2';
$combine = $dat|$channel;
$combimix= md5($combine);
$link .= $combimix ;
$link .='" width="850" height="520" frameborder="0" scrolling="no" allowtransparency="true" >';
$link .='<p>Your browser does not support iframes.</p>';
$link .='</iframe>';
}else{
$link .= '<center> You need to be logd in to see this iframe';
}


// Set the filename of the template you want to use for this file.
$template->set_filenames(array(
'body' => 'portal/block/multiplay.html',
));

?>

maar ik gebruik de code in een CMS portal phpbb3 portal5.0 premod. en die maakt gewoon verbinding met mysql server met een username en dat is geen root.
Je maakt nergens een database verbinding voordat je de query's gebruikt. Daardoor probeert die het maar met root zonder wachtwoord.
omdat het in een portal is gebouwd zou het een verbinding moeten hebben met de DB. dus ik moet de php file vinden die de verbinding maakt en die erin plakken denk ik.

Ik vermoed includen en niet plakken anders moet je de gegevens op twee plekken wijzigen als ze verranderen.

Reageren