[PHP] Notice: Undefined index pass2

Fermé
zérémy - 11 juil. 2012 à 12:59
UgglyBoy Messages postés 422 Date d'inscription mercredi 24 septembre 2008 Statut Membre Dernière intervention 30 mai 2015 - 11 juil. 2012 à 21:34
Bonjour, j'ai une erreur sous easyphp 12 :
Notice: Undefined index: pass2 in C:\Program Files (x86)\EasyPHP-12.0\www\a transferer\inscription.php on line 112

-------------------------------------------------------------------------
CODE :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css1.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css2.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css4.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css5.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css6.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css7.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css8.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css9.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css10.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css11.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css12.css" rel="stylesheet" type="text/css" media="screen" />
<title>Acceuil || Topi-RPG</title>
<style>
a /* Liens par défaut (non survolés) */
{
color: #8BBFAC;
}

a:hover /* Apparence au survol des liens */
{
color: #DDD59E;
}
body
{
background-color: #F7F5FF;
behavior: url("csshover.htc");
font-family: verdana;
}
#logo
{
color: #a4a5a0;
}
#green
{
color: #40A45B;
}
#red
{
color: #D81010;
}
label
{
display: block;
width: 180px;
float: left;
}
</style>
<body>
<header>


</header>
<nav><HR noshade size="2" width="60%" align="center"></nav>
<div id="menu_dynamique">
<ul>
<li class="end first"><a href="#">Accueil</a></li>
<li class="extend">
<a href="#">Membres</a>
<ul>
<li class="extend first">
<a href="#">Inscription</a>
</li>
<li class="end last"><a href="#">Connection</a></li>
</ul>
</li>
<li class="extend">
<a href="#">On recrute !</a>
<ul>
<li class="extend first">
<a href="#">Participer</a>
</li>
<li class="end">
<a href="#">Équipe</a>
</li>
<li class="end last"><a href="#">Informations</a></li>
</ul>
</li>
<li class="extend, end last">
<a href="#">Contact</a>
<ul>
<li class="extend first">
<a href="#">Administrateur</a>
</li>
<li class="end">
<a href="#">Sous Admin</a>
</li>
<li class="end last"><a href="#">Équipe</a></li>
</ul>
</li>
</ul>
</div>
<?php
$_POST['mail']='02485430184218435410544577903929645964263459675909166406406264065026414564856041541051000064945219648051084105410840231055018121842163846030105428402184254657451210055468451321854096031034567487454115410357484048545415105045500515156450054612185450500540054';
if (preg_match("/^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$/",
$_POST['mail'])) {
echo '<font color=\'green\'>E-mail valide</font>';
}
else if ($_POST['mail'] == '02485430184218435410544577903929645964263459675909166406406264065026414564856041541051000064945219648051084105410840231055018121842163846030105428402184254657451210055468451321854096031034567487454115410357484048545415105045500515156450054612185450500540054')
{
echo '';
}
else{
echo '<font color=\'red\'>E-mail invalide</font>';
}
?>
<?php
$_POST['pass']='02485430184218435410544577903929645964263459675909166406406264065026414564856041541051000064945219648051084105410840231055018121842163846030105428402184254657451210055468451321854096031034567487454115410357484048545415105045500515156450054612185450500540054';
if ($_POST['pass'] == $_POST['pass2']) {
echo '<font color=\'green\'>Mot de passe valide</font>';
}
else if ($_POST['pass'] == '102485430184218435410544577903929645964263459675909166406406264065026414564856041541051000064945219648051084105410840231055018121842163846030105428402184254657451210055468451321854096031034567487454115410357484048545415105045500515156450054612185450500540054')
{
echo '';
}
else{
echo '<font color=\'red\'>Mot de passe invalide</font>';
}
?>
<br />
<section>
<h1>Formulaire d'inscription</h1>
<form>
<label for="pseudo">Pseudo :</label><input type="text" id="pseudo" /><br />
<label for="mail">E-Mail :</label><input type="text" id="mail" /><br />
<label for="pass">Mot de passe :</label><input type="password" id="pass" /><br />
<label for="pass2">Retaper le mot de passe :</label><input type="password" id="pass2" /><br />
<label for="jj, mm, aaaa">Date de naissance :</label><select id="jj"><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option><option>19</option><option>20</option><option>21</option><option>22</option><option>23</option><option>24</option><option>25</option><option>26</option><option>27</option><option>28</option><option>29</option><option>30</option><option>31</option></select>/<select id="mm"><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option></select>/<select it="aaaa"><option>1920</option><option>1921</option><option>1922</option><option>1923</option><option>1924</option><option>1925</option><option>1926</option><option>1927</option><option>1928</option><option>1929</option><option>1930</option><option>1931</option><option>1932</option><option>1933</option><option>1934</option><option>1935</option><option>1936</option><option>1937</option><option>1938</option><option>1939</option><option>1940</option><option>1941</option><option>1942</option><option>1943</option><option>1944</option><option>1945</option><option>1946</option><option>1947</option><option>1948</option><option>1949</option><option>1950</option><option>1951</option><option>1952</option><option>1953</option><option>1954</option><option>1955</option><option>1956</option><option>1957</option><option>1958</option><option>1959</option><option>1960</option><option>1961</option><option>1962</option><option>1963</option><option>1964</option><option>1965</option><option>1966</option><option>1967</option><option>1968</option><option>1969</option><option>1970</option><option>1971</option><option>1972</option><option>1973</option><option>1974</option><option>1975</option><option>1976</option><option>1977</option><option>1978</option><option>1979</option><option>1980</option><option>1981</option><option>1982</option><option>1983</option><option>1984</option><option>1985</option><option>1986</option><option>1987</option><option>1988</option><option>1989</option><option>1990</option><option>1991</option><option>1992</option><option>1993</option><option>1994</option><option>1995</option><option>1996</option><option>1997</option><option>1998</option><option>1999</option><option>2000</option><option>2001</option><option>2002</option><option>2003</option><option>2004</option><option>2005</option><option>2006</option><option>2007</option><option>2008</option><option>2009</option><option>2010</option><option>2011</option><option>2012</option></select><br />
<input type="submit" value="Valider"><input type="reset" value="Rester"></form>
</body>
</html>



A voir également:

1 réponse

UgglyBoy Messages postés 422 Date d'inscription mercredi 24 septembre 2008 Statut Membre Dernière intervention 30 mai 2015 64
11 juil. 2012 à 21:34
ceci est une information que te donne php, disant que le tableau $_POST ne contient pas de clé "pass2".

ce n'est pas un problème en soit, tu peux désactiver ce genre de message dans le php.ini

par contre ça peut être utile pour comprendre pourquoi ça ne marche pas (debug)
0