Bonjour,
Voici un petit script sympa pour gérer simplement un espace membre.
Mon problème est le suivant :
Ce script redirige bien mes membres vers leur page attitré, mais j'aimerais que lorsque des mauvais identifiants sont tapé, qu'il soit redirigé vers une page défini, au lieu d'afficher un message sur la page d'envoi.
Voici le code :
Je vous remercie d'avance...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
49
50
51
52
53
54
55
56
57
58
59 <? error_reporting(E_ALL ^ E_NOTICE); if (isset($argv)) $option=implode($argv,""); if ($option == "") { echo "<CENTER><FONT size=7>Identification</FONT>"; echo "<FORM name='entre' ACTION='index.php?verif' METHOD=POST>"; echo "Votre Pseudo : <INPUT TYPE='text' NAME='nom' SIZE=20 MAXLENGTH=40><BR><BR>"; echo "Votre Password : <INPUT TYPE='password' NAME='pass' SIZE=20 MAXLENGTH=40><BR><BR>"; echo "<INPUT TYPE='submit' VALUE=' Valider '>"; echo "</FORM></CENTER>"; } elseif ($option == "verif") { $tbnm= array(); $tbps= array(); $tbpg= array(); /// Entrez, suivant les modeles ci-dessous, les noms, mots de passe, et page de redirection /// des membres... $tbnm[0] = "nom1"; $tbps[0] = "pass1"; $tbpg[0] = "redirect1.html"; $tbnm[1] = "nom2"; $tbps[1] = "pass2"; $tbpg[1] = "redirect2.html"; $szn= sizeof( $tbnm ); $szp= sizeof( $tbps ); $szg= sizeof( $tbpg ); if ($szn != $szp || $szn != $szg || $szg != $szp) { echo "<FONT COLOR='red'>Erreur dans le fichier source...Veuillez contacter le WebMaster"; echo "<SCRIPT LANGUAGE='JavaScript'>"; echo "window.setTimeout('window.location = \"index.php?faux\"', 2000)"; echo "</SCRIPT>"; exit; } for($i=0; $i < $szn; $i++ ) { if ($nom == $tbnm[$i] && $pass == $tbps[$i]) { echo "<SCRIPT LANGUAGE='JavaScript'>"; echo "window.location = '$tbpg[$i]'"; echo "</SCRIPT>"; exit; } } echo "<SCRIPT LANGUAGE='JavaScript'>window.setTimeout('window.location = \"index.php?faux\"', 1)</SCRIPT>"; } elseif ($option == "faux") { echo "<CENTER>Vous n'êtes pas inscrit dans la base de donnée, veuillez vous y inscrire auprès du Webmaster</CENTER>"; exit; } ?>
Partager