login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Sommige velden geen Update? :s

Offline BigBug - 03/01/2006 21:35
Avatar van BigBugPHP expert Pagina:
  1. <?php
  2. include 'config.php';
  3. connect();
  4. startshit();
  5. ?>
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html xmlns="http://www.w3.org/1999/xhtml">
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  10. <title>Profiel wijzigen</title>
  11. <link rel="stylesheet" href="style.css" type="text/css">
  12. </head>
  13.  
  14. <body>
  15. <?php
  16. if(isset($_SESSION['username']))
  17. {
  18. $query = mysql_query("SELECT * FROM leden WHERE username='".$_SESSION['username']."'") or die(mysql_error());
  19. while($user = mysql_fetch_array($query))
  20. {
  21. ?>
  22. <form action="" method="post">
  23. <table border="0" style="border: 1px solid <?php echo $randkleur; ?>;" cellspacing="0" cellpadding="5">
  24. <tr>
  25. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst">Email:</td>
  26. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst"><input type="text" name="email" value="<?php echo stripslashes($user['email']); ?>" /></td>
  27. </tr>
  28. <tr>
  29. <td bgcolor="<?php echo $kleur1; ?>" class="border_down nettetekst">Voornaam:</td>
  30. <td bgcolor="<?php echo $kleur1; ?>" class="border_down nettetekst"><input type="text" name="email2" value="<?php echo stripslashes($user['firstname']); ?>" /></td>
  31. </tr>
  32. <tr>
  33. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst">Achternaam:</td>
  34. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst"><input type="text" name="email3" value="<?php echo stripslashes($user['lastname']); ?>" /></td>
  35. </tr>
  36. <tr>
  37. <td bgcolor="<?php echo $kleur1; ?>" class="border_down nettetekst">Geslacht:</td>
  38. <td bgcolor="<?php echo $kleur1; ?>" class="border_down nettetekst"><select name="menwoman"><option value="Man">Man</option><option value="Vrouw">Vrouw</option></select></td>
  39. </tr>
  40. <tr>
  41. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst">Woonplaats:</td>
  42. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst"><input type="text" name="email5" value="<?php echo stripslashes($user['livingplace']); ?>" /></td>
  43. </tr>
  44. <tr>
  45. <td bgcolor="<?php echo $kleur1; ?>" class="border_down nettetekst">Geboortedatum:</td>
  46. <td bgcolor="<?php echo $kleur1; ?>" class="border_down nettetekst">
  47. <select name="dag">
  48. <option value="01" >01</option>
  49. <option value="02" >02</option>
  50. <option value="03" >03</option>
  51. <option value="04" >04</option>
  52. <option value="05" >05</option>
  53. <option value="06" >06</option>
  54. <option value="07" >07</option>
  55. <option value="08" >08</option>
  56. <option value="09" >09</option>
  57. <option value="10" >10</option>
  58. <option value="11" >11</option>
  59. <option value="12" >12</option>
  60. <option value="13" >13</option>
  61. <option value="14" >14</option>
  62. <option value="15" >15</option>
  63. <option value="16" >16</option>
  64. <option value="17" >17</option>
  65. <option value="18" >18</option>
  66. <option value="19" >19</option>
  67. <option value="20" >20</option>
  68. <option value="21" >21</option>
  69. <option value="22" >22</option>
  70. <option value="23" >23</option>
  71. <option value="24" >24</option>
  72. <option value="25" >25</option>
  73. <option value="26" >26</option>
  74. <option value="27" >27</option>
  75. <option value="28" >28</option>
  76. <option value="29" >29</option>
  77. <option value="30" >30</option>
  78. <option value="31" >31</option>
  79. </select>
  80. &nbsp;
  81. <select name="maand">
  82. <option value="Januari" >Januari</option>
  83. <option value="Februari" >Februari</option>
  84. <option value="Maart" >Maart</option>
  85. <option value="April" >April</option>
  86. <option value="Mei" >Mei</option>
  87. <option value="Juni" >Juni</option>
  88. <option value="Juli" >Juli</option>
  89. <option value="Augustus" >Augustus</option>
  90. <option value="September" >September</option>
  91. <option value="Oktober" >October</option>
  92. <option value="November" >November</option>
  93. <option value="December" >December</option>
  94. </select>
  95.  
  96. &nbsp;
  97. <select name="jaar">
  98. <option value="1940" >1940</option>
  99. <option value="1941" >1941</option>
  100. <option value="1942" >1942</option>
  101. <option value="1943" >1943</option>
  102. <option value="1944" >1944</option>
  103. <option value="1945" >1945</option>
  104. <option value="1946" >1946</option>
  105. <option value="1947" >1947</option>
  106. <option value="1948" >1948</option>
  107. <option value="1949" >1949</option>
  108. <option value="1950" >1950</option>
  109. <option value="1951" >1951</option>
  110. <option value="1952" >1952</option>
  111. <option value="1953" >1953</option>
  112. <option value="1954" >1954</option>
  113. <option value="1955" >1955</option>
  114. <option value="1956" >1956</option>
  115. <option value="1957" >1957</option>
  116. <option value="1958" >1958</option>
  117. <option value="1959" >1959</option>
  118. <option value="1960" >1960</option>
  119. <option value="1961" >1961</option>
  120. <option value="1962" >1962</option>
  121. <option value="1963" >1963</option>
  122. <option value="1964" >1964</option>
  123. <option value="1965" >1965</option>
  124. <option value="1966" >1966</option>
  125. <option value="1967" >1967</option>
  126. <option value="1968" >1968</option>
  127. <option value="1969" >1969</option>
  128. <option value="1970" >1970</option>
  129. <option value="1971" >1971</option>
  130. <option value="1972" >1972</option>
  131. <option value="1973" >1973</option>
  132. <option value="1974" >1974</option>
  133. <option value="1975" >1975</option>
  134. <option value="1976" >1976</option>
  135. <option value="1977" >1977</option>
  136. <option value="1978" >1978</option>
  137. <option value="1979" >1979</option>
  138. <option value="1980" >1980</option>
  139. <option value="1981" >1981</option>
  140. <option value="1982" >1982</option>
  141. <option value="1983" >1983</option>
  142. <option value="1984" >1984</option>
  143. <option value="1985" >1985</option>
  144. <option value="1986" >1986</option>
  145. <option value="1987" >1987</option>
  146. <option value="1988" >1988</option>
  147. <option value="1989" >1989</option>
  148. <option value="1990" >1990</option>
  149. <option value="1991" >1991</option>
  150. <option value="1992" >1992</option>
  151. <option value="1993" >1993</option>
  152. <option value="1994" >1994</option>
  153. <option value="1995" >1995</option>
  154. <option value="1996" >1996</option>
  155. <option value="1997" >1997</option>
  156. <option value="1998" >1998</option>
  157. </select>
  158.  
  159. </td>
  160. </tr>
  161. <tr>
  162. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst">MSN Adres: </td>
  163. <td bgcolor="<?php echo $kleur2; ?>" class="border_down nettetekst"><input type="text" name="email7" value="<?php echo stripslashes($user['msn']); ?>" /></td>
  164. </tr>
  165. <tr>
  166. <td bgcolor="<?php echo $kleur1; ?>" class="nettetekst">Skype Adres: </td>
  167. <td bgcolor="<?php echo $kleur1; ?>" class="nettetekst"><input type="text" name="email8" value="<?php echo stripslashes($user['skype']); ?>" /></td>
  168. </tr>
  169. <tr>
  170. <td bgcolor="<?php echo $kleur1; ?>" class="nettetekst">&nbsp;</td>
  171. <td bgcolor="<?php echo $kleur1; ?>" class="nettetekst"><input type="submit" name="submit" value="Updaten!" /></td>
  172. </tr>
  173. </table>
  174. </form>
  175. <?php
  176. }
  177. }
  178. else
  179. {
  180. echo 'Je bent niet ingelogd!';
  181. }
  182. if($_SERVER['REQUEST_METHOD'] == "POST")
  183. {
  184. if(controleer($_POST['email']))
  185. {
  186. $email = addslashes(htmlentities($_POST['email']));
  187. $firstname = addslashes(htmlentities($_POST['firstname']));
  188. $lastname = addslashes(htmlentities($_POST['lastname']));
  189. $livingplace = addslashes(htmlentities($_POST['livingplace']));
  190. $birthdate = addslashes(htmlentities("".$_POST['dag']." ".$_POST['maand']." ".$_POST['jaar'].""));
  191. $msn = addslashes(htmlentities($_POST['msn']));
  192. $skype = addslashes(htmlentities($_POST['skype']));
  193.  
  194. if(empty($email))
  195. {
  196. $email = addslashes('-');
  197. }
  198. if(empty($firstname))
  199. {
  200. $firstname = addslashes('-');
  201. }
  202. if(empty($lastname))
  203. {
  204. $lastname = addslashes('-');
  205. }
  206. if(empty($livingplace))
  207. {
  208. $livingplace = addslashes('-');
  209. }
  210. if(empty($birthdate))
  211. {
  212. $birthdate = addslashes('-');
  213. }
  214. if(empty($msn))
  215. {
  216. $msn = addslashes('-');
  217. }
  218. if(empty($skype))
  219. {
  220. $skype = addslashes('-');
  221. }
  222.  
  223. mysql_query("UPDATE leden SET email='".$email."', firstname='".$firstname."', lastname='".$lastname."', menwoman='".$_POST['menwoman']."', livingplace='".$livingplace."', birthday='".$birthdate."', msn='".$msn."', skype='".$skype."' WHERE username='".$_SESSION['username']."'") or die(mysql_error());
  224. echo "Je profiel is geupdate! <a href='loginoverzicht.php'>Klik hier</a> om terug te keren naar het login overzicht.";
  225. }
  226. else
  227. {
  228. echo 'Je emailadres is niet correct!';
  229. }
  230. }
  231. ?>
  232.  
  233. </body>
  234. </html>
MySQL table:
  1. CREATE TABLE `leden` (
  2. `id` INT NOT NULL AUTO_INCREMENT ,
  3. `username` VARCHAR( 255 ) NOT NULL ,
  4. `password` VARCHAR( 255 ) NOT NULL ,
  5. `email` VARCHAR( 255 ) NOT NULL ,
  6. `registerdate` VARCHAR( 255 ) NOT NULL ,
  7. `firstname` VARCHAR( 255 ) NOT NULL ,
  8. `lastname` VARCHAR( 255 ) NOT NULL ,
  9. `menwoman` VARCHAR( 255 ) NOT NULL ,
  10. `livingplace` VARCHAR( 255 ) NOT NULL ,
  11. `birthday` VARCHAR( 255 ) NOT NULL ,
  12. `msn` VARCHAR( 255 ) NOT NULL ,
  13. `skype` VARCHAR( 255 ) NOT NULL ,
  14. `avatarurl` VARCHAR( 255 ) NOT NULL ,
  15. `ip` VARCHAR(255) NOT NULL ,
  16. `rang` VARCHAR(255) NOT NULL,
  17. PRIMARY KEY ( `id` )
  18. ) TYPE = MYISAM ;


Hij update deze velden niet: firstname, lastname, livingplace, msn, skype....

Ik kan zelf de fout niet ontdenkken hoor..

Btw, sorry, beetje slordige code.... 

Bij voorbaat dank, Jeroen

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.223s