amelioration d'une section membres

amelioration d'une section membres - PHP - Programmation

Marsh Posté le 21-06-2002 à 22:59:25    

bijour a tous
 
voila mes fichiers :  
 
index.php :

Code :
  1. <?
  2. //-- pour inclure la page --
  3. if(isset($page))
  4. {
  5. include("./".$page.".php" );
  6. }
  7. else
  8. {
  9. include('erreur404.php' );
  10. }
  11. unset($page);
  12. ?>
  13. <HTML>
  14. <HEAD>
  15. <TITLE>Gliss4ever.com - <?echo "$titre" ?></TITLE>
  16. <STYLE TYPE="text/css">
  17. BODY {
  18. MARGIN=10;
  19. scrollbar-face-color: #0099CC; 
  20. scrollbar-shadow-color: #117292;
  21. scrollbar-highlight-color: #6FD0F1;
  22. scrollbar-3dlight-color: #000000; 
  23. scrollbar-darkshadow-color: #000000; 
  24. scrollbar-track-color: #57729D; 
  25. scrollbar-arrow-color: #253C61;
  26. }
  27. INPUT {
  28. COLOR: #000000;
  29. BACKGROUND-COLOR: #d1d1d1;
  30. FONT-FAMILY: Verdana;
  31. FONT-SIZE: 8 pt;
  32. BORDER-COLOR: #7d7d7d;
  33. BORDER-WIDTH: 1; 
  34. }
  35. SELECT{
  36. COLOR:#000000;
  37. BACKGROUND-COLOR:#d1d1d1;
  38. FONT-FAMILY:Verdana;
  39. FONT-SIZE:8pt;
  40. BORDER-COLOR:#7d7d7d;
  41. BORDER-WIDTH:1;
  42. HEIGHT:20px;
  43. .haut{
  44. COLOR: #99ccff;
  45. FONT-FAMILY: Verdana;
  46. FONT-SIZE: 7.5pt;
  47. FONT-WEIGHT: bold;
  48. }
  49. .tableaucentre{
  50. FONT-SIZE: 4.5pt;
  51. }
  52. .corps{
  53. FONT-FAMILY: Verdana;
  54. COLOR: #ffffff;
  55. FONT-SIZE:8pt;
  56. }
  57. .titre2{
  58. FONT-FAMILY:Verdana;
  59. FONT-SIZE:9pt;
  60. COLOR:#FFFFFF;
  61. FONT-WEIGHT:bold;
  62. }
  63. A.menu{
  64. FONT-FAMILY: Verdana;
  65. COLOR: #155D8E;
  66. FONT-SIZE: 7.5pt;
  67. FONT-WEIGHT: bold;
  68. TEXT-DECORATION: none;
  69. }
  70. A.menu:hover{
  71. FONT-FAMILY: Verdana;
  72. COLOR: #F59244;
  73. FONT-SIZE: 7.5pt;
  74. FONT-WEIGHT: bold;
  75. TEXT-DECORATION: none;
  76. }
  77. A.petitmenu{
  78. FONT-FAMILY: Verdana;
  79. COLOR: #155D8E;
  80. FONT-SIZE: 6.5pt;
  81. TEXT-DECORATION: none;
  82. }
  83. A.petitmenu:hover{
  84. FONT-FAMILY: Verdana;
  85. COLOR: #F59244;
  86. FONT-SIZE: 6.5pt;
  87. TEXT-DECORATION: none;
  88. }
  89. .petitmenu{
  90. FONT-FAMILY: Verdana;
  91. COLOR: #155D8E;
  92. FONT-SIZE: 6.5pt;
  93. }
  94. .titre{
  95. FONT-FAMILY: Verdana;
  96. COLOR: #003471;
  97. FONT-SIZE: 9pt;
  98. FONT-WEIGHT: bold;
  99. }
  100. </STYLE>
  101. <!--Script survol-->
  102. <SCRIPT language="javascript">
  103. <!--
  104. function VersionNavigateur(Netscape, Explorer)
  105. {
  106. if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape' ) ||
  107. (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft' ))
  108. return true;
  109. else return false;
  110. }
  111. //-->
  112. </SCRIPT>
  113. </HEAD>
  114. <BODY bgcolor="#435D85" text="#ffffff">
  115. <TABLE width="100%" height="100%" cellPadding="0" cellSpacing="0" border="0">
  116. <TR>
  117. <TD width="100%" height="123" colSpan="5"><img src="Interface/space.gif"><? include ("haut.php" ); ?></TD>
  118. </TR>
  119. <TR>
  120. <TD width="100%" height="11" colSpan="5"><img src="Interface/space.gif"></TD>
  121. </TR>
  122. <TR>
  123. <TD width="15.10%" height="*"><? include ("menuarticles.php" ); ?></TD>
  124. <TD rowSpan="5" width="1.92%" height="*"><img src="Interface/space.gif"></TD>
  125. <TD rowSpan="5" width="*" height="*"><? include ("milieu.php" ); ?></TD>
  126. <TD rowSpan="5" width="1.92%" height="*"><img src="Interface/space.gif"></TD>
  127. <TD width="15.10%" height="*"><? include ("menumembres.php" ); ?></TD>
  128. </TR>
  129. <TR>
  130. <TD width="1.92%" height="*"><img src="Interface/space.gif"></TD>
  131. <TD width="1.92%" height="*"><img src="Interface/space.gif"></TD>
  132. </TR>
  133. <TR>
  134. <TD width="15.10%" height="*"><? include ("menuaccessoires.php" ); ?></TD>
  135. <TD width="15.10%" height="*"><? include ("menugoodies.php" ); ?></TD>
  136. </TR>
  137. <TR>
  138. <TD width="1.92%" height="*"><img src="Interface/space.gif"></TD>
  139. <TD width="1.92%" height="*"><img src="Interface/space.gif"></TD>
  140. </TR>
  141. <TR>
  142. <TD width="15.10%" height="*"><? include ("menuriders.php" ); ?></TD>
  143. <TD width="15.10%" height="*"><? include ("menupartenaires.php" ); ?></TD>
  144. </TR>
  145. <TR>
  146. <TD colSpan="5" width="*" height="10"><img src="Interface/space.gif"></TD>
  147. </TR>
  148. <TR>
  149. <TD colSpan="5" width="*" height="33"><? include ("bas.php" ); ?></TD>
  150. </TR>
  151. </TABLE>
  152. </BODY>
  153. </HTML>


 
milieu.php :

Code :
  1. <TABLE width="100%" border="0" cellSpacing="0" cellPadding="0" height="*">
  2. <TR>
  3. <TD width="19" height="24" background="Interface/milieuhg.gif"></TD>
  4. <TD width="*" height="24" background="Interface/bordmilieuh.gif"><img src="Interface/space.gif"></TD>
  5. <TD width="43" height="24" background="Interface/milieutraits.gif"></TD>
  6. <TD align="center" vAlign="top" width="300" height="24" background="Interface/bordmilieuh.gif"><img src="Interface/space.gif" width="1" height="3"><BR><FONT class="titre">
  7. <?
  8. echo "$titre";
  9. ?>
  10.       </FONT>
  11. </TD>
  12. <TD width="43" height="24" background="Interface/milieutraits.gif"></TD>
  13. <TD width="*" height="24" background="Interface/bordmilieuh.gif"><img src="Interface/space.gif"></TD>
  14. <TD width="18" height="24" background="Interface/milieuhd.gif"></TD>
  15. </TR>
  16. </TABLE>
  17. <TABLE width="100%" border="0" cellSpacing="0" cellPadding="0" height="93%">
  18. <TR>
  19. <TD width="8" height="*" background="Interface/bordmilieug.gif"></TD>
  20. <TD align="center" width="*" height="*" bgcolor="#62b0dd">
  21. <FONT class="tableaucentre"><BR></FONT>
  22. <TABLE width="98%" height="97%" cellSpacing="0" cellPadding="0" border="0">
  23. <TR>
  24. <TD align="center" style="background-image: url(Interface/Planche.gif); background-repeat: no-repeat; background-position: bottom center;">
  25. <?
  26. echo "$texte";
  27. ?>
  28. </TD>
  29. </TR>
  30. </TABLE>       
  31. </TD>
  32. <TD width="8" height="*" background="Interface/bordmilieud.gif"></TD>
  33. </TR>
  34. <TR>
  35. <TD width="8" height="17" background="Interface/milieubg.gif"><img src="Interface/space.gif"></TD>
  36. <TD width="*" height="17" background="Interface/bordmilieub.gif"><img src="Interface/space.gif"></TD>
  37. <TD width="8" height="17" background="Interface/milieubd.gif"><img src="Interface/space.gif"></TD>
  38. </TR>
  39. </TABLE>


 
inscription.php :

Code :
  1. <? $titre="Inscription";
  2. $texte="<TABLE border=\"0\" cellSpacing=\"2\" cellPadding=\"2\">
  3. <TR>
  4. <TD colSpan=\"5\" align=\"center\" bgcolor=\"#0099cc\"><FONT class=\"titre2\">Informations generales pour créer un compte</FONT></TD>
  5. </TR>
  6. <TR>
  7. <TD colSpan=\"5\" align=\"center\"><FONT size=\"1\" face=\"Verdana\">( Les champs marqués * sont obligatoires )</FONT></TD>
  8. </TR>
  9. <TR>
  10. <TD colSpan=\"5\" align=\"center\"><FONT size=\"1\"> </FONT></TD>
  11. </TR>
  12. <TR>
  13. <TD><FONT class=\"corps\">Pseudo :  *</FONT></TD>
  14. <TD align=\"center\"><FORM><INPUT type=\"text\" name=\"pseudo\" size=\"15\" maxlength=\"35\"></TD>
  15. <TD width=\"20\"></TD>
  16. <TD><FONT class=\"corps\">Site perso :</FONT></TD>
  17. <TD align=\"center\"><INPUT type=\"text\" name=\"site_perso\" size=\"15\" maxlength=\"35\"></TD></TR>
  18. <TR>
  19. <TD><FONT class=\"corps\">Mot de passe :  *</FONT></TD>
  20. <TD align=\"center\"><INPUT type=\"password\" name=\"passe\" size=\"15\" maxlength=\"35\"></TD>
  21. <TD></TD>
  22. <TD><FONT class=\"corps\">Numero icq :</FONT></TD>
  23. <TD align=\"center\"><INPUT type=\"text\" name=\"num_icq\" size=\"15\" maxlength=\"35\"></TD>
  24. </TR>
  25. <TR>
  26. <TD><FONT class=\"corps\">Confirmer :  *</FONT></TD>
  27. <TD align=\"center\"><INPUT type=\"password\" name=\"confir_passe\" size=\"15\" maxlength=\"35\"></TD>
  28. <TD></TD>
  29. <TD><FONT class=\"corps\">Location :</FONT></TD>
  30. <TD align=\"center\"><INPUT type=\"text\" name=\"location\" size=\"15\" maxlength=\"35\"></TD>
  31. </TR>
  32. <TR>
  33. <TD><FONT class=\"corps\">Email :  *</FONT></TD>
  34. <TD align=\"center\"><INPUT type=\"text\" name=\"email\" size=\"15\" maxlength=\"35\"></TD>
  35. <TD></TD>
  36. <TD><FONT class=\"corps\">Métier, occupation :</FONT></TD>
  37. <TD align=\"center\"><INPUT type=\"text\" name=\"occupation\" size=\"15\" maxlength=\"35\"></TD>
  38. </TR>
  39. <TR>
  40. <TD><FONT class=\"corps\">Date de naissance :</FONT></TD>
  41. <TD align=\"center\"><INPUT type=\"text\" name=\"jj\" size=\"2\" maxlength=\"2\"><INPUT type=\"text\" name=\"mm\" size=\"2\" maxlength=\"2\"><INPUT type=\"text\" name=\"aaaa\" size=\"4\" maxlength=\"4\"></TD>
  42. </TR>
  43. <TR>
  44. <TD></TD>
  45. <TD></TD>
  46. <TD></TD>
  47. <TD></TD>
  48. <TD align=\"center\"><INPUT type=\"submit\" name=\"envoyer\" size=\"10\" value=\"Envoyer\"></TD>
  49. </TR>
  50. </FORM>
  51. </TABLE>";
  52. ?>


 
ajouter.php :

Code :
  1. <?
  2. if (empty($pseudo) OR empty($passe) OR empty($confir_passe) OR empty($email))
  3. {
  4. echo 'Les champs pseudo, mot de passe et email sont obligatoires';
  5. }
  6. elseif ($jj<1 AND $jj>31) OR ($mm<1 AND $mm>12) OR ($aaaa<1900 AND $aaaa>2003)
  7. {
  8. echo 'La date de naissance est incorrecte';
  9. }
  10. $date_naissance=$jj."-".$mm."-".$aaaa;
  11. elseif ($passe!=$confir_passe)
  12. {
  13. echo 'La confirmation du mot de passe est incorrecte';
  14. }
  15. $verif_url=strtolower($site_perso);
  16. $verif_url=substr("$verif_url", 0, 7);
  17. elseif ($verif_url!="http://" );
  18. {
  19. echo "L'url est incorrecte";
  20. }
  21. $point=strpos($email,"." );
  22. $aroba=strpos($email,"@" );
  23. elseif (empty($point) OR empty($aroba))
  24. {
  25. echo "L'email est incorrect";
  26. $date_inscription=date(d-m-Y | H:i);
  27. else
  28. {
  29. $db=mysql_connect('localhost', 'root', '' );
  30. mysql_select_db('mysql', $db) or die ("Connexion échouée" );
  31. $sql= "INSERT INTO membres (id,pseudo,passe,email,date_naissance,site_perso,num_icq,location,occupation,date_inscription) VALUES ('', '$pseudo', '$passe', '$email', 'date_naissance', 'site_perso', '$num_icq', 'location', '$occupation', 'date_inscription' )";
  32. mysql_query($sql);
  33. echo 'Inscription effectuée avec succès.';
  34. mysql_close();
  35. }
  36. ?>


 
et ma table membres :
 
CREATE TABLE membres (
id INT(11) not null AUTO_INCREMENT,
pseudo VARCHAR(35) not null,
passe VARCHAR(35) not null,
email VARCHAR(35) not null,
date_naissance VARCHAR(35) not null,
site_perso VARCHAR(35) not null,
num_icq INT not null,
location VARCHAR(35) not null,
occupation VARCHAR(35) not null,
date_inscription VARCHAR(35) not null,
nb_posts INT not null,
avatar VARCHAR(35) not null,
signature VARCHAR(35) not null,
citation VARCHAR(35) not null,
PRIMARY KEY (id)
)TYPE=MyISAM  
 
 
mercideja d'avoir lu jusqu'ici :D
ya plusieur pb :
 
c nul de stocker un formulaire dans une variable, mais comment trouver une alternative en gardan la variable pour le titre.
 
sinon c chelou car qd je remplit le formulair et envoie et me met pas yes ca marche et ne fait rien, et aucun enregistrement dans la table
 
merci a tous ceux qui essairont d'eclairer ma lanterne :D :D

Reply

Marsh Posté le 21-06-2002 à 22:59:25   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed