PHPbb3 -> inscription sur mon site

Eléphant du PHP | 53 Messages

30 mars 2012, 22:34

Bonjour,

J'ai un gros problème qui persiste. Quand je met le formulaire :
<?php
define('IN_PHPBB', true);
$phpbb_root_path =  './phpBB3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup('ucp');
//ajout captcha
if ($config['enable_confirm'])
{
   include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
   $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
   $captcha->init(CONFIRM_REG);
}
//
$error=array();
$data = array(
   'username'         => utf8_normalize_nfc(request_var('username', '', true)),
   'password'         => request_var('password', '', true),
   'password_confirm'   => request_var('password_confirm', '', true),
   'email'            => strtolower(request_var('email', '')),
   'email_confirm'      => strtolower(request_var('email_confirm', '')),
);
if (isset($_POST['submit']))
{
   $error = validate_data($data, array(
      'username'         => array(
         array('string', false, $config['min_name_chars'], $config['max_name_chars']),
         array('username', '')),
      'password'      => array(
         array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
         array('password')),
      'password_confirm'   => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
      'email'            => array(
         array('string', false, 6, 60),
         array('email')),
      'email_confirm'      => array('string', false, 6, 60),
   ));
   $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
   
   //ajout captcha
   if ($config['enable_confirm'])
   {
      $vc_response = $captcha->validate($data);
      if ($vc_response !== false)
      {
         $error[] = $vc_response;
      }

      if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
      {
         $error[] = $user->lang['TOO_MANY_REGISTERS'];
      }
   }
   //
   if (!sizeof($error))
   {
      if ($data['password'] != $data['password_confirm'])
      {
         $error[] = $user->lang['NEW_PASSWORD_ERROR'];
      }
      if ($data['email'] != $data['email_confirm'])
      {
         $error[] = $user->lang['NEW_EMAIL_ERROR'];
      }
   }
   if (!sizeof($error))
   {
      $group_name =  'REGISTERED';
      $sql = 'SELECT group_id
               FROM ' . GROUPS_TABLE . "
               WHERE group_name = '" . $db->sql_escape($group_name) . "'
                  AND group_type = " . GROUP_SPECIAL;
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $db->sql_freeresult($result);
      if (!$row)
      {
         trigger_error('NO_GROUP');
      }
      $group_id = $row['group_id'];
      $user_row = array(
         'username'            => $data['username'],
         'user_password'         => phpbb_hash($data['password']),
         'user_email'         => $data['email'],
         'group_id'            => (int) $group_id,
         'user_timezone'         => (float) $config['board_timezone'],
         'user_dst'            => $config['board_dst'],
         'user_lang'            => basename($user->lang_name),
         'user_type'            => USER_NORMAL,
         'user_actkey'         => '',
         'user_ip'            => $user->ip,
         'user_regdate'         => time(),
         'user_inactive_reason'   => 0,
         'user_inactive_time'   => 0,
      );
      $user_id = user_add($user_row);
      if ($user_id === false)
      {
         trigger_error('NO_USER', E_USER_ERROR);
      }
      //ajout captcha
      if ($config['enable_confirm'])
      {
         $captcha->reset();
      }
      $url = append_sid('./index.php');
      die( '<html>
         <head>
            <META http-equiv="Refresh"
            content="10; URL=' . $url . '">
         </head>
         <body>
         Votre compte a été enregistré avec succès<br />
         Vous allez être maintenant redirigé vers <a href="' . $url . '">la page d\'index</a>
         </body>
      </html>');
   }
}
echo '<html>
<head>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
   <title>Vous enregistrer</title>
</head>
<body>
   <form method="post">
<h1>Vous enregistrer</h1>';
//ajout patcha
if ($config['enable_confirm'])
{
   $confirm_id = $captcha->confirm_id;
   $confirm_code = true;
   $confirm_image='<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&confirm_id=' . $confirm_id . '&type=' . CONFIRM_REG) . '" alt="" title="" />';
}
if (sizeof($error))
{
   echo '<font color="red"><b>' . implode('<br />', $error) . '</b></font>';;

}
?>
<table>
   <tr>
      <td align="right">Pseudonyme:</td>
      <td><input type="text" tabindex="1" name="username" size="25" value="<?php echo $data['username']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Mot de passe:</td>
      <td><input type="password" tabindex="2" name="password" size="25" value="<?php echo $data['password']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Confirmez votre mot de passe:</td>
      <td><input type="password" tabindex="3" name="password_confirm" size="25" value="<?php echo $data['password_confirm']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Email:</td>
      <td><input type="text" tabindex="4" name="email" size="25" maxlength="100" value="<?php echo $data['email']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Confirmez votre Email</td>
      <td><input type="text" tabindex="5" name="email_confirm" size="25" maxlength="100" value="<?php echo $data['email_confirm']; ?>" /></td>
   </tr>
<?php
if ($confirm_code)
{
?>
   <tr>
      <td><?php echo $user->lang['CONFIRM_CODE'] . '<br />' . $user->lang['CONFIRM_CODE_EXPLAIN']; ?></td>
      <td><input type="hidden" name="confirm_id" value="<?php echo $confirm_id; ?>" /><?php echo $confirm_image; ?></td>
   </tr>
   <tr>
      <td>&nbsp;</td>
      <td><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" /></td>
   </tr>
<?php
}
?>
   <tr>
      <td colspan="2" align="center">
         <input type="reset" value="Remettre &agrave; z&eacute;ro" name="reset" />&nbsp;
         <input type="submit" name="submit" id ="submit" value="S'enregistrer" />
      </td>
   </tr>
</table>
</form>
</body>
</html>
Qui viens de : http://forums.phpbb-fr.com/documentatio ... l#p1183736

Un problème surgit :

Code : Tout sélectionner

Fatal error: Cannot redeclare deregister_globals() (previously declared in C:\wamp\www\Mini-entreprise\forum\includes\startup.php:28) in C:\wamp\www\Mini-entreprise\forum\includes\startup.php on line 98
Ce qui m'intrigue le plus c'est que quand je le met sur une page vierge tout va bien.
Sinon, si je l'assemble sur ma page que j'ai crée, sa me met l'erreur ci-dessus.

Merci d'avance. Locos974.

Eléphant du PHP | 53 Messages

31 mars 2012, 20:20

Personne ne sait ?

ViPHP
xTG
ViPHP | 7331 Messages

31 mars 2012, 21:09

Regarder les lignes 98 et 28 du fichier startup.php qui n'est visiblement pas le fichier que tu nous as mis dans ce post. ;)

Eléphant du PHP | 53 Messages

31 mars 2012, 22:13

Fichier startup.php :
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

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

// Report all errors, except notices and deprecation messages
if (!defined('E_DEPRECATED'))
{
	define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

/*
* Remove variables created by register_globals from the global scope
* Thanks to Matt Kavanagh
*/
function deregister_globals()
{
	$not_unset = array(
		'GLOBALS'	=> true,
		'_GET'		=> true,
		'_POST'		=> true,
		'_COOKIE'	=> true,
		'_REQUEST'	=> true,
		'_SERVER'	=> true,
		'_SESSION'	=> true,
		'_ENV'		=> true,
		'_FILES'	=> true,
		'phpEx'		=> true,
		'phpbb_root_path'	=> true
	);

	// Not only will array_merge and array_keys give a warning if
	// a parameter is not an array, array_merge will actually fail.
	// So we check if _SESSION has been initialised.
	if (!isset($_SESSION) || !is_array($_SESSION))
	{
		$_SESSION = array();
	}

	// Merge all into one extremely huge array; unset this later
	$input = array_merge(
		array_keys($_GET),
		array_keys($_POST),
		array_keys($_COOKIE),
		array_keys($_SERVER),
		array_keys($_SESSION),
		array_keys($_ENV),
		array_keys($_FILES)
	);

	foreach ($input as $varname)
	{
		if (isset($not_unset[$varname]))
		{
			// Hacking attempt. No point in continuing unless it's a COOKIE (so a cookie called GLOBALS doesn't lock users out completely)
			if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))
			{
				exit;
			}
			else
			{
				$cookie = &$_COOKIE;
				while (isset($cookie['GLOBALS']))
				{
					if (!is_array($cookie['GLOBALS']))
					{
						break;
					}

					foreach ($cookie['GLOBALS'] as $registered_var => $value)
					{
						if (!isset($not_unset[$registered_var]))
						{
							unset($GLOBALS[$registered_var]);
						}
					}
					$cookie = &$cookie['GLOBALS'];
				}
			}
		}

		unset($GLOBALS[$varname]);
	}

	unset($input);
}

// If we are on PHP >= 6.0.0 we do not need some code
if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
{
	/**
	* @ignore
	*/
	define('STRIP', false);
}
else
{
	@set_magic_quotes_runtime(0);

	// Be paranoid with passed vars
	if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
	{
		deregister_globals();
	}

	define('STRIP', (get_magic_quotes_gpc()) ? true : false);
}

// Prevent date/time functions from throwing E_WARNING on PHP 5.3 by setting a default timezone
if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get'))
{
	// For PHP 5.1.0 the date/time functions have been rewritten
	// and setting a timezone is required prior to calling any date/time function.

	// Since PHP 5.2.0 calls to date/time functions without having a timezone set
	// result in E_STRICT errors being thrown.
	// Note: We already exclude E_STRICT errors
	// (to be exact: they are not included in E_ALL in PHP 5.2)

	// In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
	// because we show E_WARNING errors and do not set a default timezone.
	// This is because we have our own timezone handling and work in UTC only anyway.

	// So what we basically want to do is set our timezone to UTC,
	// but we don't know what other scripts (such as bridges) are involved,
	// so we check whether a timezone is already set by calling date_default_timezone_get().

	// Unfortunately, date_default_timezone_get() itself might throw E_WARNING
	// if no timezone has been set, so we have to keep it quiet with @.

	// date_default_timezone_get() tries to guess the correct timezone first
	// and then falls back to UTC when everything fails.
	// We just set the timezone to whatever date_default_timezone_get() returns.
	date_default_timezone_set(@date_default_timezone_get());
}

$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
Ligne 28 :

Code : Tout sélectionner

function deregister_globals()
Ligne 98 : Au dessus de la ligne 98 il y a :

Code : Tout sélectionner

unset($GLOBALS[$varname]); } unset($input);

Une idée ?

ViPHP
xTG
ViPHP | 7331 Messages

01 avr. 2012, 09:29

Le fichier ne serait pas inclus deux fois par hasard ?

Eléphant du PHP | 53 Messages

01 avr. 2012, 11:24

De quoi entendais vous par là ?

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

01 avr. 2012, 11:40

Le message d'erreur est clair la fonction deregister_globals() ne peux pas être déclarée deux fois, hors c'est ce qui ce passe ligne 98 (et qui est déjà fait ligne 28).

Donc soit tu vire la redeclaration de la fonction (qui correspond à une inclusion de fichier ?)
Soit utilisé include/require_once !

@+
Il en faut peu pour être heureux ......

Eléphant du PHP | 53 Messages

02 avr. 2012, 17:29

Je ne comprend pas ce que vous voulez dire.. Avérez dire j'ai dû mal..
Dans quelle fichier j’enlève la ligne ? Dans register, il ne fait pas appelle à la fonction : register_globals.

Donc je ne voie pas quoi faire, si je la retire : bug total.
Fin, pouvez vous m'expliquer un peux plus clairement même si vous pensez que pour vous cela est clair.

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

02 avr. 2012, 22:39

Fatal error => grosse boulette
: Cannot redeclare deregister_globals() => on peux pas redéclarer une fonction déja déclarée (cette fonction s'appelle deregister_globals)
previously declared in C:\wamp\www\Mini-entreprise\forum\includes\startup.php:28 => la fonction est déclarée dans le fichier startup.php à la ligne 28
in C:\wamp\www\Mini-entreprise\forum\includes\startup.php on line 98 => c'est a cette ligne la qu'a lieu le problème !

maintenant le code fournit ne peux pas fournir cette erreur, y a autre chose, la vérité est ailleurs ...... :mrgreen:
Il en faut peu pour être heureux ......

Eléphant du PHP | 53 Messages

04 avr. 2012, 10:41

function deregister_globals()
{
	$not_unset = array(
		'GLOBALS'	=> true,
		'_GET'		=> true,
		'_POST'		=> true,
		'_COOKIE'	=> true,
		'_REQUEST'	=> true,
		'_SERVER'	=> true,
		'_SESSION'	=> true,
		'_ENV'		=> true,
		'_FILES'	=> true,
		'phpEx'		=> true,
		'phpbb_root_path'	=> true
	);

	// Not only will array_merge and array_keys give a warning if
	// a parameter is not an array, array_merge will actually fail.
	// So we check if _SESSION has been initialised.
	if (!isset($_SESSION) || !is_array($_SESSION))
	{
		$_SESSION = array();
	}

	// Merge all into one extremely huge array; unset this later
	$input = array_merge(
		array_keys($_GET),
		array_keys($_POST),
		array_keys($_COOKIE),
		array_keys($_SERVER),
		array_keys($_SESSION),
		array_keys($_ENV),
		array_keys($_FILES)
	);

	foreach ($input as $varname)
	{
		if (isset($not_unset[$varname]))
		{
			// Hacking attempt. No point in continuing unless it's a COOKIE (so a cookie called GLOBALS doesn't lock users out completely)
			if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))
			{
				exit;
			}
			else
			{
				$cookie = &$_COOKIE;
				while (isset($cookie['GLOBALS']))
				{
					if (!is_array($cookie['GLOBALS']))
					{
						break;
					}

					foreach ($cookie['GLOBALS'] as $registered_var => $value)
					{
						if (!isset($not_unset[$registered_var]))
						{
							unset($GLOBALS[$registered_var]);
						}
					}
					$cookie = &$cookie['GLOBALS'];
				}
			}
		}

		unset($GLOBALS[$varname]);
	}

	unset($input);
}
Le fichier startup de la ligne 28 à 98, le problème est que la ligne 98 indique : ' } ' sauf que, les ' } ' ou ' { ' sont tous ouverts puis refermer.
A partir de la je sèche...

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

04 avr. 2012, 17:43

Il serait pas inclus deux fois ce fichier des fois ?


Parce que bon le code que tu nous ne peux pas faire de re déclaration, soit c'est pas le bon fichier (y en à d'autre avec ce nom?) soit il s'agit d'inclusion en chaise (ce qui ne serait pas étonnant) et dans tout les fichier y a deux fois cette fonction.

Y a pas beaucoup de possibilité si php le dit faut le croire, après faut voir le code complet de la page qui reçoit le formulaire.

@+
Il en faut peu pour être heureux ......

Eléphant du PHP | 53 Messages

05 avr. 2012, 17:58

Y'aurais t'il une possibilité de se contacter via Skype ou autre ? Pour vous montrez mieux ce qu'il se passe.

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 8758 Messages

06 avr. 2012, 16:27

Heu non, de plus ici ton problème peux en aider d'autres.

Il existe aussi des forums dédier à phpbb qui seront peut être plus à même de t'aider.

Mais globalement cette fonction est sûrement inclus autre par pour que tu ai ce message ?
Le code indiqué ici est il complet (la page complète ?).

@+
Il en faut peu pour être heureux ......

Eléphant du PHP | 53 Messages

07 avr. 2012, 22:16

Le code de ma page register en entier :
<?php session_start();      include_once("config.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">


<head>
   <title><?php echo $name;?></title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta name="copyright" content="Copyright" />
   <meta name="classification" content="" />
   <meta name="description" content="<?php echo $name;?>" />
   <meta name="keywords" content="<?php echo $name;?>" />
   <meta name="author" content="Sorrow" />
   <link href="style/theme.css" rel="stylesheet" type="text/css" media="screen" />
   <link rel="shortcut icon" href="<?php echo $ico;?>">
   <script type="text/javascript" src="script.js" ></script>
   <script type="text/javascript" src="js/jquery.js" ></script>
   <script type="text/javascript" src="js/function.js"></script>
   <script type="text/javascript" src="js/flash.js"></script>
   <script type="text/javascript">
   function Popup_Picture() {window.open( "http://localhost/Web/index.php?page=404", "Changer d'Avatar", "height = 450, width = 510, status = no, resizable = no, directories = no, location = no, scrollbars = yes, toolbar = no, menubar = no" )}
   </script>
   <style type='text/css'>
	  #header { width: 1025px; height: 351px; background: url(images/theme/header/header1.png) top no-repeat; margin: 0 auto; }
   .Style1 {
	color: #FF0000;
	font-weight: bold;
}
   </style>
</head>
<body>
<div id="wrapper">
   <div id="header">
	  <div id="sidebar_top">
		 <div class="sidebar">
			
			<span class="left">
			   <div class="realmlist"><?php if (empty($_SESSION['account']))
			   { ?>
				  <?php if (empty($_SESSION['account']))
			   { ?>
				  <input  readonly="readonly" value="Bienvenu Visiteur" />			   </div>
				  <?php }
				  else
				  {
				  ?>
				  <input  readonly="readonly" value="Bienvenu <?php echo $_SESSION['account'] ;?>" />			   </div>
				  <?php }?>
				  <?php }
				  else
				  {
				  ?>
				  <input  readonly="readonly" value="Bienvenu <?php echo $_SESSION['account'] ;?>" />			   </div>
				  <?php }?>
			   
			</span>
			<div class="clear"></div>
		 </div>
	  </div>
   </div>
  <?php include('menu.php')?>;
</div>
<div class="wrap-content">
<div id="box_758">
<div class="top">
<img src="images/theme/title/.png">
</div><div class="back">
<div class="box_top"></div>
<div class="box">





<?php
define('IN_PHPBB', true);
$phpbb_root_path =  './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup('ucp');
//ajout captcha
if ($config['enable_confirm'])
{
   include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
   $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
   $captcha->init(CONFIRM_REG);
}
//
$error=array();
$data = array(
   'username'         => utf8_normalize_nfc(request_var('username', '', true)),
   'password'         => request_var('password', '', true),
   'password_confirm'   => request_var('password_confirm', '', true),
   'email'            => strtolower(request_var('email', '')),
   'email_confirm'      => strtolower(request_var('email_confirm', '')),
);
if (isset($_POST['submit']))
{
   $error = validate_data($data, array(
      'username'         => array(
         array('string', false, $config['min_name_chars'], $config['max_name_chars']),
         array('username', '')),
      'password'      => array(
         array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
         array('password')),
      'password_confirm'   => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
      'email'            => array(
         array('string', false, 6, 60),
         array('email')),
      'email_confirm'      => array('string', false, 6, 60),
   ));
   $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
   
   //ajout captcha
   if ($config['enable_confirm'])
   {
      $vc_response = $captcha->validate($data);
      if ($vc_response !== false)
      {
         $error[] = $vc_response;
      }

      if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
      {
         $error[] = $user->lang['TOO_MANY_REGISTERS'];
      }
   }
   //
   if (!sizeof($error))
   {
      if ($data['password'] != $data['password_confirm'])
      {
         $error[] = $user->lang['NEW_PASSWORD_ERROR'];
      }
      if ($data['email'] != $data['email_confirm'])
      {
         $error[] = $user->lang['NEW_EMAIL_ERROR'];
      }
   }
   if (!sizeof($error))
   {
      $group_name =  'REGISTERED';
      $sql = 'SELECT group_id
               FROM ' . GROUPS_TABLE . "
               WHERE group_name = '" . $db->sql_escape($group_name) . "'
                  AND group_type = " . GROUP_SPECIAL;
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $db->sql_freeresult($result);
      if (!$row)
      {
         trigger_error('NO_GROUP');
      }
      $group_id = $row['group_id'];
      $user_row = array(
         'username'            => $data['username'],
         'user_password'         => phpbb_hash($data['password']),
         'user_email'         => $data['email'],
         'group_id'            => (int) $group_id,
         'user_timezone'         => (float) $config['board_timezone'],
         'user_dst'            => $config['board_dst'],
         'user_lang'            => basename($user->lang_name),
         'user_type'            => USER_NORMAL,
         'user_actkey'         => '',
         'user_ip'            => $user->ip,
         'user_regdate'         => time(),
         'user_inactive_reason'   => 0,
         'user_inactive_time'   => 0,
      );
      $user_id = user_add($user_row);
      if ($user_id === false)
      {
         trigger_error('NO_USER', E_USER_ERROR);
      }
      //ajout captcha
      if ($config['enable_confirm'])
      {
         $captcha->reset();
      }
      $url = append_sid('./index.php');
      die( '<html>
         <head>
            <META http-equiv="Refresh"
            content="10; URL=' . $url . '">
         </head>
         <body>
         Votre compte a été enregistré avec succès<br />
         Vous allez être maintenant redirigé vers <a href="' . $url . '">la page d\'index</a>
         </body>
      </html>');
   }
}
echo '<html>
<head>
   <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
   <title>Vous enregistrer</title>
</head>
<body>
   <form method="post">
<h1>Vous enregistrer</h1>';
//ajout patcha
if ($config['enable_confirm'])
{
   $confirm_id = $captcha->confirm_id;
   $confirm_code = true;
   $confirm_image='<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&confirm_id=' . $confirm_id . '&type=' . CONFIRM_REG) . '" alt="" title="" />';
}
if (sizeof($error))
{
   echo '<font color="red"><b>' . implode('<br />', $error) . '</b></font>';;

}
?>
<table>
   <tr>
      <td align="right">Pseudonyme:</td>
      <td><input type="text" tabindex="1" name="username" size="25" value="<?php echo $data['username']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Mot de passe:</td>
      <td><input type="password" tabindex="2" name="password" size="25" value="<?php echo $data['password']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Confirmez votre mot de passe:</td>
      <td><input type="password" tabindex="3" name="password_confirm" size="25" value="<?php echo $data['password_confirm']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Email:</td>
      <td><input type="text" tabindex="4" name="email" size="25" maxlength="100" value="<?php echo $data['email']; ?>" /></td>
   </tr>
   <tr>
      <td align="right">Confirmez votre Email</td>
      <td><input type="text" tabindex="5" name="email_confirm" size="25" maxlength="100" value="<?php echo $data['email_confirm']; ?>" /></td>
   </tr>
<?php
if ($confirm_code)
{
?>
   <tr>
      <td><?php echo $user->lang['CONFIRM_CODE'] . '<br />' . $user->lang['CONFIRM_CODE_EXPLAIN']; ?></td>
      <td><input type="hidden" name="confirm_id" value="<?php echo $confirm_id; ?>" /><?php echo $confirm_image; ?></td>
   </tr>
   <tr>
      <td>&nbsp;</td>
      <td><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" /></td>
   </tr>
<?php
}
?>
   <tr>
      <td colspan="2" align="center">
         <input type="reset" value="Remettre &agrave; z&eacute;ro" name="reset" />&nbsp;
         <input type="submit" name="submit" id ="submit" value="S'enregistrer" />
      </td>
   </tr>
</table>
</form>
</body>
</body>
</html>





</div>
<div class="box_footer"></div>
</div>
<div class="back_footer"></div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
   <div id="footer">
	  <div class="text">
		 <br />
		 <br />
		 <br />
		 <br />
		 <img src="images/theme/footer.png" alt="" /><br /><br />
		 
	  </div>
   </div>
</body>

</html>

Eléphant du PHP | 53 Messages

09 avr. 2012, 13:50

Sujet résolu erreur de ma part. Merci pour votre aide !