J'ai commencé le PHP ya 1 semaine, et j'ai un probleme avec ce code :
Code : Tout sélectionner
<?
//3
if(isset($nom) && isset($secret) && isset($email) ) {
//4
$fichier=fopen("demande.txt", r);
//5
$info= $nom . ":" . $email . ":" . $secret . ";";
//6
$infosauvegarde= fread($fichier, filesize('demande.txt'));
//7
$info= $info . $infosauvegarde;
//8
fwrite($fichier, $info);
fclose($fichier);
//9
header('Location: index.htm'); }
//11
else{
//12
print('<html><head><title>Inscription</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head><body>');
print('form method='post' action='inscription.php'>');
//13
if(!isset($nom)){
print(<p>Veuillez taper votre nom sil vous plait, dans le cas contraire vous pouvez <a href='index.htm'>partir</a> <input type='text' name='nom'></p>');
}
if(!isset($email)) {
print("<p>Veuillez taper votre E mail sil vous plait, dans le cas contraire vous pouvez <a href='index.htm'>partir</a> <input type='text' name='email'></p>");
if(!isset($secret)) {
print('<p>Veuillez taper votre mot de passe s'il vous plait, dans le cas contraire vous pouvez <a href='index.htm'>partir</a> <input type='text' name='secret'></p>');
}
//14
if(isset($nom)) {
print('<input type='hidden' name='nom' value='$nom'>');
}
if(isset($email)) {
print('<input type='hidden' name='email' value'$email'>');
}
if(isset($secret)) {
print('input type='hidden' name'secret' value='$secret'>');
}
//15
print('<p><input type='submit' name='submit' value='Envoyer'></p></form></body></html>');
?>
Code : Tout sélectionner
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Recrutement</title>
</head>
<body>
Recrutement
<br>
<form method="post" action="inscription.php"><p>Donner votre nom d'utilisateur <input type="text" name="nom"></p>
<p>Donner votre adresse E-mail
<input type="text" name="email"></p>
<p>Donner un mot de passe (tout les caractères) <input type="text" name="secret"></p>
<p> <input type="submit" name="submit" value="S'inscrire"> </p>
</form>
<p align="center"><a href="index.htm">Acceuil</a></p>
</body>
</html>