Seite 1 von 2

nach hack ->update ->nun 2 fehler im board

Verfasst: 11.05.2005 21:12
von namenloserposter
nabend :)
nachdem ich es durch abwesenheit verpennt hatte mein board zu updaten, wurde es gehackt. ich habe daraufhin alle updates gemacht und auf die neuste version gewächselt.
nun habe ich zwei probleme:

1. wenn man sich registrieren will und auf den button registrieren klickt kommt eine weisse seite mit dem tag:

Code: Alles auswählen

Parse error: parse error, unexpected $ in /home/www/htdocs/domain.de/forum/profile.php on line 131
2. wenn ich auf einen usernamen klicke kommt auch ein weisser screen mit:

Code: Alles auswählen

Parse error: parse error, unexpected $ in /home/www/htdocs/domain.de/forum/profile.php on line 131
kann mir jemand sagen was da falsch läuft ? :)

danke dafür schon mal :)

grüsse !!!

Verfasst: 11.05.2005 22:09
von pandorra
du musst sinnlose $ zeichen in den betreffenden dateien und den jeweiligen zeilen löschen....
mit bissl überlegen klappts doch auch :/
jaaaa, kein englisch bla, dict.leo.org

sry, bin grad mies drauf und lass meinen frust an unschuldigen im inet ab ;)

Verfasst: 11.05.2005 22:25
von namenloserposter
ok danke für die hilfe :)
die sache ist nur das ich absolut unfit in php bin :) habe alles immer nur anhand von tuts und so realisiert !
deswegen frage ich :)

aber danke trotz der schlechten laune :)

Verfasst: 11.05.2005 22:32
von pandorra
das ist das problem :/
das hatte rein garnichts mit php zu tun...
wenn du über den zebrastreifen gehst musst dich ja auch nicht mit den vorschriften befassen,
wie selbige in welchem verfahren auf welche teerart aufgerbacht werden müssen
(scheiss beispiel, aber es zieht :D)
das war simples logisches denken und eine textdatei durchsuchen ;)
wenn es was mit php zu tun gehabt hätte,
hättest du das prob ja nicht beheben können ;)

Verfasst: 12.05.2005 04:41
von namenloserposter
so :) aber welches von den: $
ist es denn ?

Code: Alles auswählen

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// End session management
//

// session id check
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
{
	$sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
}
else
{
	$sid = '';
}

//
// Set default email variables
//
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/profile.'.$phpEx : 'profile.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

$server_url = $server_protocol . $server_name . $server_port . $script_name;

// -----------------------
// Page specific functions
//
function gen_rand_string($hash)
{
	$chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J',  'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T',  'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');

	$max_chars = count($chars) - 1;
	srand( (double) microtime()*1000000);

	$rand_str = '';
	for($i = 0; $i < 8; $i++)
	{
		$rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] : $rand_str . $chars[rand(0, $max_chars)];
	}

	return ( $hash ) ? md5($rand_str) : $rand_str;
}
//
// End page specific functions
// ---------------------------

//
// Start of program proper
//
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
	$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
	$mode = htmlspecialchars($mode);

	if ( $mode == 'viewprofile' )
	{
		include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
		exit;
	}
	else if ( $mode == 'editprofile' || $mode == 'register' )
	{
		if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
		{
			redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
		}

	 else if ( $mode == 'confirm' )
   {
      // Visual Confirmation
      if ( $userdata['session_logged_in'] )
      {
         exit;
      }

      include($phpbb_root_path . 'includes/usercp_confirm.'.$phpEx);
      exit;
   }
	else if ( $mode == 'sendpassword' )
	{
		include($phpbb_root_path . 'includes/usercp_sendpasswd.'.$phpEx);
		exit;
	}
	else if ( $mode == 'activate' )
	{
		include($phpbb_root_path . 'includes/usercp_activate.'.$phpEx);
		exit;
	}
	else if ( $mode == 'email' )
	{
		include($phpbb_root_path . 'includes/usercp_email.'.$phpEx);
		exit;
	}
}

redirect(append_sid("index.$phpEx", true));

?>

Verfasst: 12.05.2005 09:32
von Leuchte
Kopierfehler, oder fehlt am Anfang der Datei das

Code: Alles auswählen

<?php
?
das hatte rein garnichts mit php zu tun...
Die Logik erkläre mir bitte noch einmal per PN :roll:

Verfasst: 12.05.2005 11:30
von pandorra
in dem code gibt es keine zeile 131 :/

@leuchte mach ich...

Verfasst: 12.05.2005 17:06
von namenloserposter
vielen dank euch ersteinmal für die hilfe und mühe !

@ leuchte; nein das ist da:

Code: Alles auswählen

<?php
/***************************************************************************
 *                                profile.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: profile.php,v 1.193.2.4 2004/07/11 16:46:17 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// End session management
//

// session id check
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
{
	$sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
}
else
{
	$sid = '';
}

//
// Set default email variables
//
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/profile.'.$phpEx : 'profile.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

$server_url = $server_protocol . $server_name . $server_port . $script_name;

// -----------------------
// Page specific functions
//
function gen_rand_string($hash)
{
	$chars = array( 'a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F', 'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J',  'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R', 's', 'S', 't', 'T',  'u', 'U', 'v', 'V', 'w', 'W', 'x', 'X', 'y', 'Y', 'z', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');

	$max_chars = count($chars) - 1;
	srand( (double) microtime()*1000000);

	$rand_str = '';
	for($i = 0; $i < 8; $i++)
	{
		$rand_str = ( $i == 0 ) ? $chars[rand(0, $max_chars)] : $rand_str . $chars[rand(0, $max_chars)];
	}

	return ( $hash ) ? md5($rand_str) : $rand_str;
}
//
// End page specific functions
// ---------------------------

//
// Start of program proper
//
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
	$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
	$mode = htmlspecialchars($mode);

	if ( $mode == 'viewprofile' )
	{
		include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
		exit;
	}
	else if ( $mode == 'editprofile' || $mode == 'register' )
	{
		if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
		{
			redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
		}

	 else if ( $mode == 'confirm' )
   {
      // Visual Confirmation
      if ( $userdata['session_logged_in'] )
      {
         exit;
      }

      include($phpbb_root_path . 'includes/usercp_confirm.'.$phpEx);
      exit;
   }
	else if ( $mode == 'sendpassword' )
	{
		include($phpbb_root_path . 'includes/usercp_sendpasswd.'.$phpEx);
		exit;
	}
	else if ( $mode == 'activate' )
	{
		include($phpbb_root_path . 'includes/usercp_activate.'.$phpEx);
		exit;
	}
	else if ( $mode == 'email' )
	{
		include($phpbb_root_path . 'includes/usercp_email.'.$phpEx);
		exit;
	}
}

redirect(append_sid("index.$phpEx", true));

?>
sagt mal habt irgendwo eine website mit evtl einem kleinen werbebanner mit pay per klick ? könnt mir ja mal die url dazu schicken. irgendwie muss ich mich ja mal erkenntlich zeigen :)

Verfasst: 12.05.2005 20:31
von namenloserposter
und das es keine zeile 131 gibt habe ich auch schon im proton gesehen :)
aber was heisst dann lane 131 und so einfach finde ich das nun schon doch nicht mehr :)

Verfasst: 13.05.2005 10:42
von MrMind
Warum er 131 anzeigt ist klar. Der PHP-Parser hat den Fehler erst am Schluss festgestellt und nimmt automatisch die nächste Zeile, somit 131, da die Datei 130 Zeilen hatte.

Der Fehler war ein Klammerfehler. Es hat eine } gefehlt.

Code: Alles auswählen

 else if ( $mode == 'editprofile' || $mode == 'register' )
   {
      if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
      {
         redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
      }

    else if ( $mode == 'confirm' ) 
da fehlt vor dem else if ( $mode == 'confirm' ) eine }, so ist es richtig:

Code: Alles auswählen

 else if ( $mode == 'editprofile' || $mode == 'register' )
   {
      if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
      {
         redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
      }
   }
    else if ( $mode == 'confirm' ) 
Habs bei mir lokal getestet. Klappt dann auch.

Bei mir hat er auch nur einen parser Error angezeigt mehr net, nichts mit $ oder so ;)

Mfg
MrMind