Précédent   Forum des professionnels en informatique > PHP > Langage > Formulaires
Formulaires Forum d'entraide sur les formulaires avec PHP. Avant de poster -> FAQ formulaires, Cours de formulaires et Sources de formulaires
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 11/12/2007, 15h28   #1
Membre du Club
 
Avatar de zabdaniel
 
Inscription : février 2007
Messages : 175
Détails du profil
Informations personnelles :
Âge : 26
Localisation : France, Paris (Île de France)

Informations forums :
Inscription : février 2007
Messages : 175
Points : 54
Points : 54
Par défaut renvoi d'information : problème

bonjour voici mon code :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?
//toujours demarrer la gestion des sessions
session_start();
function authentifier($userLogin, $userPwd) {  
GLOBAL $user, $passwd, $host;  
mysql_connect($host,$user,$passwd);  
mysql_select_db("dift1147_auth");  
$requeteID = mysql_query("SELECT login 
FROM users 
WHERE login='$userLogin' AND password=encrypt('$userPwd', password)");  
$returnValue=(mysql_num_rows($requeteID) > 0);  
mysql_free_result($requeteID); 
mysql_close();  
return $returnValue;
}
//verifier si les variables attendues existent et ensuite
//si la combinaison de login/mdp est valide
if ((array_key_exists("userLogin", $_POST)) &&    
(array_key_exists("userPwd", $_POST)) &&    
(authentifier($_POST["userLogin"], $_POST["userPwd"]))) {  
//validation reussi: afficher le "vrai" contenu  
$_SESSION["login"]=$_POST["userLogin"];  
header("Location: indexAuthentifie.php");  
exit;
}
?>
<!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>  
<title>IFT1147  $ucCurrentSection</title>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>  
<title>Login</title>
</head>
<body>
<form method="post" action="<?=$_SERVER["PHP_SELF"]?>">
<table border="0">  <tr>    <td width="60">Login</td>    
<td width="80">      
<input type="text" name="userLogin" size="14" maxlength="8" value="<?php =$_POST["userLogin"]?>">    
</td>  
</tr>  
<tr> 
<td>Password</td>    
<td>      <input type="text" name="userPwd" size="14" maxlength="8">    </td>  
</tr>  <tr>    
<td colspan="2" style="text-align:center">      
<input type="submit" value="Login">    
</td>  
</tr></table></form></body></html>
Mais cette ligne me pose problème
<input type="text" name="userLogin" size="14" maxlength="8" value="<?php =$_POST["userLogin"]?>">
parce que j'ai <?php =$_POST["userLogin"]?> dasn la case au lieu d'avoir la valeur demandée
zabdaniel est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/12/2007, 15h44   #2
Membre à l'essai
 
Inscription : mai 2007
Messages : 63
Détails du profil
Informations personnelles :
Âge : 27

Informations forums :
Inscription : mai 2007
Messages : 63
Points : 22
Points : 22
Essaie plutot çà a la place

Code :
1
2
<input type="text" name="userLogin" size="14" maxlength="8" value="<?php echo  $_POST["userLogin"]?>">
The SorroW est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/12/2007, 16h39   #3
Rédacteur
 
Avatar de RideKick
 
Homme
Directeur technique
Inscription : septembre 2006
Messages : 5 959
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Directeur technique
Secteur : High Tech - Produits et services télécom et Internet

Informations forums :
Inscription : septembre 2006
Messages : 5 959
Points : 10 889
Points : 10 889
je dirais meme mieux :

Code :
<input type="text" name="userLogin" size="14" maxlength="8" value="<?php echo  $_POST['userLogin'] ; ?>">
__________________
Pas de questions techniques en MP please

Mon site perso
RideKick est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 07h05.


 
 
 
 
Partenaires

Hébergement Web