WAMP SEVER probleme

Fermé
Faww Messages postés 6 Date d'inscription samedi 21 mars 2015 Statut Membre Dernière intervention 21 mars 2015 - Modifié par Faww le 21/03/2015 à 14:09
NHenry Messages postés 15151 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 4 septembre 2024 - 21 mars 2015 à 18:49
Bonjour j'ai un probleme dès que j'ouvre le fichier install.php d'un site que j'ai telecharger, Je ne vois pas de page avec WAMP mais ça :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.9 (Win64) PHP/5.5.12 Server at localhost Port 80


Je pense que je n'ai pas dû remplir les information sur le code source si il y en a, pouvez vous m'aidez SVP ?

Peut Etre ligne : 108 et 126;127;128;129.

Et voila le code source du fichier install.php :

<?php
if($_GET['page'] != 'inscription')
{
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Infos base SQL</title>
<style type="text/css">
.note {
 font-size:1.1em;
 font-style:italic;
}
.ok {
 color:green;
 font-weight:bold;
}
.echec {
 color:red;
 font-weight:bold;
}
h1 {
 font-size:1.4em; /* taille du titre */
}
label {
 font-size:1.2em; /* taille du texte pour les "label" */
 display:block; /* on affiche les "label" en tant que block et non pas inline */ 
 width:210px; /* on leur met une taille pour aligner nos zones de texte */
 float:left; /* flottant à gauche */
}
.header {
 -moz-border-radius-topleft:10px;
 -moz-border-radius-topright:10px;
 background-color:#dbdee2;
 height:10px;
 margin-top:80px;
}

.footer {
 -moz-border-radius-bottomleft:10px;
 -moz-border-radius-bottomright:10px;
 background-color:white;
 height:10px;
 margin-bottom:80px;
}
.corps {
 padding-top:20px;
 min-height:320px;
 overflow:hidden;
 background:#ffffff url(images/admin/pannel.gif) repeat-x;
 
}
.menu {
 border-right:1px solid #CCCFD3;
 float:left;
 font-size:1em;
 padding:0;
 width:20%;
}
.blocMilieu {
 float:right;
 width:76%;
}
.texte {
 text-align:justify;
 width:40%;
}
body {
 font-family:Arial;
 font-size:0.75em;
 color:#536482;
 background:#b7b7b7 url(http://image.jeuxvideo.com/css_img/defaut/body_bg.jpg) repeat-x;
}
a:link, a:visited {
 color:#105289;
 text-decoration:none;
}

li {
 border-right: 1px;
 border-color: #c7c7c7;
}
</style>
</head>
<body>
<?php
define('BAS_PAGE', '</div></div></div><div class="footer"></div>');
define('RETOUR', '<br /><br /><input type="button" value="Retour" onclick="history.back()">');
define('OK', '<span class="ok">OK</span><br />');
define('ECHEC', '<span class="echec">ECHEC</span>');
  
echo '
 <div class="header">
 </div>
 <div class="corps">
 <div class="menu">
   <ul>
    <li><a href="install.php?page=installation">Installation</a></li>
    <li><a href="install.php?page=licence">Licence</a></li>
   </ul>
  </div>
';
}

if(isset($_GET['page']) && $_GET['page'] == 'installation')
{ 
 if(isset($_POST['hote'], $_POST['base'], $_POST['login'], $_GET['id']) AND $_GET['id'] == 1)
 {
  echo '
  <div class="blocMilieu">
   <div class="texte">
    <h1>Informations sur la base de donnees MySQL :</h1>
  ';

  $fichier = 'sql.php';
  
  if(filesize($fichier ) > 0) // si le fichier existe et qu'il n'est pas vide alors
  {
   echo '
   Fichier de configuration déjà existant. Installation interrompue.'. RETOUR . BAS_PAGE;
   exit;
  }

  // on crée nos variables, et au passage on retire les éventuels espaces 
  $hote = trim($_POST['hote']);
  $login = trim($_POST['login']);
  $mdp = trim($_POST['mdp']);
  $base = trim($_POST['base']);

  // on vérifie la connectivité avec le serveur avant d'aller plus loin
  if(@!mysql_connect($hote, $login, $mdp))
  {
   echo '
   Mauvais paramètres de connexion.'. RETOUR . BAS_PAGE;
   exit;
  }

  // on vérifie la connectivité avec la base avant d'aller plus loin 
  if(@!mysql_select_db($base)) 
  {
   echo '
   Mauvais nom de base.'. RETOUR . BAS_PAGE;
   exit;
  } 

  // le texte que l'on va mettre dans le config.php
  $texte = '<?php
  mysql_connect(\'' . $hote . '\', \'' . $login . '\', \'' . $mdp . '\');
  mysql_select_db(\''. $base .'\');
  mysql_unbuffered_query(\'SET NAMES UTF8\');
  ?>';
  
  // on vérifie s'il est possible d'ouvrir le fichier
  if(@!$ouvrir = fopen($fichier, 'w+')) 
  {
  echo 'Impossible d\'ouvrir le fichier : <strong>'. $fichier .'</strong>.'. RETOUR . BAS_PAGE;
  exit;
  }

  // s'il est possible d'écrire dans le fichier alors on ne se gêne pas
  if(fwrite($ouvrir, $texte) == FALSE) 
  {
  echo 'Impossible d\'écrire dans le fichier : <strong>'. $fichier .'</strong>.'. RETOUR . BAS_PAGE;
  exit;
  }

  // Début - MySQL
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `admin` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      `passe` varchar(10) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);
   
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `avertir` (
      `id` mediumint(8) NOT NULL AUTO_INCREMENT,
      `idMessage` int(11) NOT NULL,
      `idTopic` mediumint(8) unsigned NOT NULL,
      `page` smallint(5) unsigned NOT NULL,
      `motif` tinyint(1) NOT NULL,
      `pseudo` varchar(15) NOT NULL,
      `acces` tinyint(3) NOT NULL,
      `auteur` varchar(15) NOT NULL,
      `timestamp` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);
   
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `bann` (
      `id` mediumint(8) NOT NULL AUTO_INCREMENT,
      `idPseudo` mediumint(8) NOT NULL,
      `idMessage` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);
   
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `bannIp` (
      `id` mediumint(5) unsigned NOT NULL AUTO_INCREMENT,
      `ip` varchar(15) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `bannTemp` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `idPseudo` mediumint(8) NOT NULL,
      `timestamp` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `categories` (
      `id` tinyint(3) NOT NULL AUTO_INCREMENT,
      `nom` varchar(255) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);

   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `commentaires` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `pseudo` varchar(15) NOT NULL,
      `message` blob NOT NULL,
      `idNews` smallint(5) unsigned NOT NULL,
      `timestamp` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__);

   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `connectes` (
      `ip` varchar(15) NOT NULL,
      `timestamp` int(11) NOT NULL,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      `acces` tinyint(3) NOT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `forum` (
      `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
      `titre` varchar(255) NOT NULL,
      `dpt` varchar(255) NOT NULL,
      `idCat` tinyint(3) NOT NULL,
      `statut` tinyint(1) NOT NULL,
      `timestamp` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `kick` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      `idForum` smallint(5) unsigned NOT NULL,
      `timestamp` int(11) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `membres` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `pseudo` varchar(15) NOT NULL,
      `passe` varchar(32) NOT NULL,
      `email` varchar(320) NOT NULL,
      `emailVu` enum(\'0\',\'1\') NOT NULL,
      `banniMp` enum(\'0\',\'1\') NOT NULL,
      `sexe` enum(\'\',\'m\',\'f\') NOT NULL,
      `age` tinyint(2) NOT NULL,
      `pays` varchar(11) NOT NULL,
      `console1` varchar(11) NOT NULL,
      `console2` varchar(11) NOT NULL,
      `console3` varchar(11) NOT NULL,
      `console4` varchar(11) NOT NULL,
      `msn` varchar(320) NOT NULL,
      `presentation` text NOT NULL,
      `avatar` text NOT NULL,
      `acces` tinyint(3) NOT NULL,
      `timestamp` int(10) unsigned NOT NULL,
      `clef` varchar(255) NOT NULL,
      `valide` enum(\'0\',\'1\') NOT NULL,
      `verif` varchar(10) NOT NULL,
      `signature` varchar(100) NOT NULL,
      `connecterA` int(10) unsigned NOT NULL,
      `dernierPassage` int(10) unsigned NOT NULL,
      `activerSmileyTitre` enum(\'0\',\'1\') NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `message` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `pseudo` varchar(15) NOT NULL,
      `message` text NOT NULL,
      `idTopic` mediumint(8) unsigned NOT NULL,
      `acces` tinyint(3) NOT NULL,
      `statut` tinyint(1) NOT NULL,
      `timestamp` int(11) unsigned NOT NULL,
      `timestampModif` int(11) unsigned NOT NULL,
      `auteurModif` varchar(15) NOT NULL,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      `ip` varchar(15) NOT NULL,
      PRIMARY KEY (`id`),
      KEY `idTopic` (`idTopic`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `moderateurs` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      `idForum` tinyint(3) NOT NULL,
      `passe` varchar(10) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `mp` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `sujet` varchar(255) COLLATE utf8_bin NOT NULL,
      `expediteur` varchar(255) COLLATE utf8_bin NOT NULL,
      `destinataire` varchar(255) COLLATE utf8_bin NOT NULL,
      `message` text CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
      `timestamp` bigint(20) NOT NULL DEFAULT \'0\',
      `vu` enum(\'0\',\'1\') COLLATE utf8_bin NOT NULL DEFAULT \'0\',
      `efface` enum(\'0\',\'1\',\'2\') COLLATE utf8_bin NOT NULL DEFAULT \'0\',
      KEY `id` (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `news` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `titre` varchar(255) NOT NULL,
      `auteur` varchar(255) NOT NULL,
      `lien` text NOT NULL,
      `intro` text NOT NULL,
      `news` text NOT NULL,
      `timestamp` bigint(20) NOT NULL,
      `statut` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `newseur` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
   
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `patch` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `titre` varchar(255) NOT NULL,
      `auteur` varchar(255) NOT NULL,
      `lien` text NOT NULL,
      `liendl` text NOT NULL,
      `intro` text NOT NULL,
      `timestamp` bigint(20) NOT NULL,
      `statut` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `topic` (
      `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
      `pseudo` varchar(15) NOT NULL,
      `titre` varchar(40) NOT NULL,
      `idForum` smallint(3) unsigned NOT NULL,
      `acces` tinyint(3) NOT NULL,
      `statut` decimal(10,1) NOT NULL,
      `idPseudo` mediumint(8) unsigned NOT NULL,
      `timestamp` int(11) NOT NULL,
      `lastTimestamp` int(11) unsigned NOT NULL,
      `nbMessage` int(11) unsigned NOT NULL,
      PRIMARY KEY (`id`),
      KEY `idForum` (`idForum`),
      KEY `idForum_2` (`idForum`),
      KEY `idForum_3` (`idForum`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
   
   mysql_unbuffered_query('CREATE TABLE IF NOT EXISTS `wallpapers` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `titre` varchar(255) NOT NULL,
      `auteur` varchar(255) NOT NULL,
      `lien` text NOT NULL,
      `liendl` text NOT NULL,
      `intro` text NOT NULL,
      `timestamp` bigint(20) NOT NULL,
      `statut` int(11) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1') OR die(mysql_error() . '<hr>' . __LINE__) ;
    
  // Fin - MySQL

  // tout s'est bien passé
  echo '
  <div style="margin-left: 22%;">
  <form method="post" action="install.php?page=installation&id=2">';
  echo 'Fichier de configuration SQL : '. OK;
  fclose($ouvrir); // on ferme le fichier

  echo 'Installation : '. OK; 
  echo '<input type="submit" value="Continuer" />
  </form></div>' . BAS_PAGE;
  exit;
 }
 elseif(isset($_GET['id']) AND $_GET['id'] == 2)
 {
  // Debut - Configuration - Forum
  if(isset($_POST['tempsChaqueTopic'], $_POST['tempsChaqueMessage'], $_POST['titreDuForum'], $_POST['nbTopicParPage'], $_POST['nbMessageParPage'], $_POST['activerMp'], $_POST['activerUpload'], $_POST['forumMaintenance'], $_POST['heureDernierCo'], $_POST['afficherDernierCo']))
  {

   $fichier = 'bdd/configforum.txt';
  
   if(filesize($fichier ) > 0) // si le fichier existe et qu'il n'est pas vide alors
   {
    echo '
    Fichier de configuration déjà existant. Installation interrompue.<br/>'. RETOUR . BAS_PAGE;
    exit;
   }

   if(empty($_POST['titreDuForum']) == 1)
   {
   echo 'Vous devez indiquer un nom pour votre forum.'. RETOUR . BAS_PAGE;
   exit;
   }
   // le texte que l'on va mettre dans le config.php
   $texte = $_POST['nbTopicParPage'] . '%' . $_POST['nbMessageParPage'] . '%' . $_POST['tempsChaqueTopic'] . '%' . $_POST['tempsChaqueMessage'] . '%' . $_POST['titreDuForum'] . '%' . $_POST['activerMp'] . '%' . $_POST['activerUpload'] . '%' . $_POST['forumMaintenance'] . '%' . $_POST['heureDernierCo'] . '%' . $_POST['afficherDernierCo'] . '%' . $_POST['adresseBanniere'] . '%' . $_POST['afficherLienDown'] . '%';
   
   // on vérifie s'il est possible d'ouvrir le fichier
   if(@!$ouvrir = fopen($fichier, 'w+')) 
   {
   echo 'Impossible d\'ouvrir le fichier : <strong>'. $fichier .'</strong>.'. RETOUR . BAS_PAGE;
   exit;
   }

   // s'il est possible d'écrire dans le fichier alors on ne se gêne pas
   if(fwrite($ouvrir, $texte) == FALSE) 
   {
   echo 'Impossible d\'écrire dans le fichier : <strong>'. $fichier .'</strong>.'. RETOUR . BAS_PAGE;
   exit;
   }
     // tout s'est bien passé
   echo '
   <div style="margin-left: 22%;">
   <form method="post" action="install.php?page=inscription">';
   echo 'Fichier de configuration (titre,banniere...) : '. OK;
   fclose($ouvrir); // on ferme le fichier
   echo '<input type="submit" value="Continuer" />
   </form></div>' . BAS_PAGE;
   exit;
  }
  // Fin - Configuration du Forum
  echo '
  <div class="blocMilieu">
   <div class="texte">
    <h1>Configuration de votre forum :</h1>
    <div style="margin-left: 22%;">
    <form method="post">
    <label>Nb de topics par page :</label> <input type="text" name="nbTopicParPage" value="25" /><br />
    <label>Nb de messages par page :</label> <input type="text" name="nbMessageParPage" value="20" /><br />
    <label>TECC<sup>1</sup> d\'un topic :</label> <input type="text" name="tempsChaqueTopic" value="10" /><br />
    <label>TECC<sup>1</sup> d\'un message :</label> <input type="text" name="tempsChaqueMessage" value="5" /><br />
    <font size="0.3em"> TECC = "Temps Entre Chaque Création"</font><br /><br />
    

    <label>Titre du forum </label> <input type="text" name="titreDuForum" value="MonForum" /><br />
    <label>Activer les Mp :</label>
    Non : <input type=radio name="activerMp" value="0"/> Oui : <input type=radio name="activerMp" value="1" checked /><br />
    <label>Activer l\'hébergement :</label>
    Non : <input type=radio name="activerUpload" value="0"/> Oui : <input type=radio name="activerUpload" value="1" checked /><br />
    <label>Forum en Maintenance  :</label>
    Non : <input type=radio name="forumMaintenance" value="0"/ checked> Oui : <input type=radio name="forumMaintenance" value="1" /><br />
    <label>Afficher liste dernier connecter :</label>
    Non : <input type=radio name="afficherLienDown" value="0" > Oui : <input type=radio name="afficherLienDown" value="1" checked/><br /> 
    <label>Afficher liste dernier connecter :</label>
     <select id="afficherDernierCo" name="afficherDernierCo">
      <option value="0">Non</option>
      <option value="1">Sur la page connecte.php</option>
      <option value="2">Sur tous le forum</option>
      <option value="3" selected="selected" >Les deux</option>
     </select>
    <br />
    <label>Durée de la période en heures : </label> <input type="text" name="heureDernierCo" value="24" /><br />
    <label>L\'adresse de la bannière : </label> <input type="text" name="adresseBanniere"/><br />
    <center><input type="submit" value="Valider" /></center>
   </form>
   </div>
  ';
  
  echo BAS_PAGE;
  exit;
 }
 else 
 {
 echo '
    <div style="margin-left: 22%;">
    <form method="post" action="install.php?page=installation&id=1">
    <label for="hote">Hôte :</label>
    <input type="text" value=localhost maxlength="40" name="hote"> Tapez localhost pour votre serveur local.<br>

    <label for="login">Utilisateur :</label>
    <input type="text" maxlength="40" name="login"> L\'utilisateur Mysql<br>

    <label for="mdp">Mot de passe :</label>
    <input type="password" maxlength="40" name="mdp"> Mot de passe de la base Mysql<br>

                                                                             <label for="base">Nom de la base :</label>
    <input type="text" maxlength="40" name="base"> Nom de la base Mysql<br>


   
    <label for="submit"> </label>
    <input type="submit" value="Envoyer" name="submit">
    </form>
    </div>
   </div>
  </div>
 </div>
 <div class="footer"></div>
 ';
 exit;
 }
}

if(isset($_GET['page']) AND $_GET['page'] == 'inscription')
{

 
// Debut - Ajouter membre

include 'base.php';

  $pseudo = '';
  $email = '';
  
  if(!empty($_POST['pseudo']) AND !empty($_POST['passe']) AND !empty($_POST['email'])) // Si les variables ne sont pas nul
  {
   if(preg_match("#^[a-zA-Z0-9\[\]_-]{3,15}$#", $_POST['pseudo'])) // Si le pseudo respecte les conditions
   {
    if(preg_match('#^[a-zA-Z0-9]{4,12}$#', $_POST['passe'])) // Si le passe respecte les conditions
    {
     if(preg_match('#^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]{2,}\.[a-zA-Z]{2,4}$#', $_POST['email'])) // Si l'adresse email est une adresse valide
     {
     // Sécurité des variables
     $pseudo = secure($_POST['pseudo']);
     $passe = secure($_POST['passe']);
     $passe2 = secure($_POST['passe2']);
     $email = secure($_POST['email']);
     

     // Génération de la clef pour validé l'inscription
     $clef = sha1(microtime(NULL)*100000);
     
     mysql_query("INSERT INTO membres VALUES('" . $_POST['idPseudo'] . "', '" . $pseudo . "', '" . hacher($passe) . "', '" . $email . "', '', '0', '', '', '', '', '', '', '', '', '', '', '100', '" . time() . "', '" . $clef . "', '1', '0', '', '', '', '')");
     
     $tablettre = array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",";","^","$","!",":","[","]","{","}");
     
     mt_srand((float) microtime()*10000);


     $a = mt_rand(0, 9);
     $b = mt_rand(0, 9);
     $c = mt_rand(0, 9);
     $d = mt_rand(0, 9);
     $e = mt_rand(0, 9);
     
     $f = mt_rand(0, 35);
     $g = mt_rand(0, 35);
     $h = mt_rand(0, 35);
     $i = mt_rand(0, 35);
     $j = mt_rand(0, 35);

     $motaleatoire =  $a.$tablettre[$f].$b.$tablettre[$g].$c.$tablettre[$h].$d.$tablettre[$i].$e.$tablettre[$j]; // Avec les nombres généré on attribut un caractère de la tablette
     
     // On insère le tout dans la table
     mysql_query('INSERT INTO admin VALUES("", "' . $_POST['idPseudo'] . '", "' . $motaleatoire . '")');
     
     //On génére un jeton totalement unique (c'est capital :D)
     $token = hacher(uniqid(rand(), true));
     //Et on le stocke
     $_SESSION['moderation']['token'] = $token;
     
     // Le membre est connecté, on crée les variables SESSION
     $_SESSION['m']['id'] = intval($_POST['idPseudo']);
     $_SESSION['m']['pseudo'] = $pseudo;
     $_SESSION['m']['pseudo_mp'] = $pseudo;
     $_SESSION['m']['acces'] = 100;
     mysql_query('UPDATE membres SET connecterA=' . time() . ' WHERE id=' . $_SESSION['m']['id']);
     
     echo '
     <div class="bloc2">
     <h3><span>Votre compte a bien ere creer.</span></h3>
     <div class="texte">
     Vous pouvez postez sur le forum directement en vous connectant avec les identifiants suivant :<br />
     Votre pseudo : <font color="red">' .$pseudo.'</font><br />
     Votre mot de passe : <font color="red">' .$passe.'</font><br />
     Votre passe d\'administration : <font color="red">' .$motaleatoire.'</font><br />
     >> <a href="admin2.php?page=0&sid='.$token.'"> Allez sur le pannel admin</a>
     </div>
     </div>';
     
     exit;
     }
    }
   }
  }
  ?>
  <form method="post" action="#"> 
   <div class="bloc2">
    <h3>Creation du compte admin</h3>
    <div class="texte">
     Ces informations sont obligatoires, mais vous pourrez toutes les modifier par la suite si bon vous semble.<br />
     La casse (difference entre les majuscules et minuscules) est prise en compte pour le mot de passe.<br /><br />
     <label for="pseudo">Pseudo :</label> <input type="text" id="pseudo" name="pseudo" value="<?php echo $pseudo; ?>" /><br/>
     <label for="passe">Mot de passe :</label> <input id="passe" type="password" name="passe" /><br/>
     <label for="passe2">Confirmation :</label> <input id="passe2" type="password" name="passe2" /><br/>
     
     <label for="email">Adresse e-mail :</label> <input id="email" type="text" name="email" value="<?php echo $email; ?>" /><br/>
     <input type="hidden" name="idPseudo" value="1" />
     
     <label for="submit"> </label>
     <input type="submit" name="submit" value="Envoyer" />
    </div> 
   </div><br />
  </form>
 <?php

 exit;
}
if(isset($_GET['page']) && $_GET['page'] == 'licence');
{
 echo '
  <div class="blocMilieu">
   <div class="texte">
   </div>
  </div>
 </div>
 <div class="footer"></div>
 ';
 exit;
}

?>

</body>
</html>
A voir également:

2 réponses

NHenry Messages postés 15151 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 4 septembre 2024 333
21 mars 2015 à 14:18
Regardes dans le fichier error.log, tu auras plus d'information.
0
Faww Messages postés 6 Date d'inscription samedi 21 mars 2015 Statut Membre Dernière intervention 21 mars 2015
21 mars 2015 à 15:32
Lequel ?
0
NHenry Messages postés 15151 Date d'inscription vendredi 14 mars 2003 Statut Modérateur Dernière intervention 4 septembre 2024 333
21 mars 2015 à 18:49
Celui généré par apache.
0
Faww Messages postés 6 Date d'inscription samedi 21 mars 2015 Statut Membre Dernière intervention 21 mars 2015
21 mars 2015 à 15:39
Quelqu'un ?
0