login  Naam:   Wachtwoord: 
Registreer je!
 Forum

[opgelost] geen pagina om te bekijken

Offline Xzero - 10/10/2005 21:48 (laatste wijziging 10/10/2005 22:19)
Avatar van XzeroPHP beginner Heey,

Ik heb zo'n script, en ik wil hem dus bekijken op een browser, maar dat gaat niet... Ik zie geen error ofzo, het is gewoon een LEEG scherm ... ik include hem in index.php, maar daar is niets mis mee... hier is mijn script:

  1. <table width="100%" class="font" cellpadding="0" cellspacing="0" align="center" style="border: none; border-collapse: collapse;">
  2. <tr>
  3. <td valign="middle" align="right"><img src="images/headers/tls.gif" border="0"></td>
  4. </tr>
  5. <tr>
  6. <td style="height: 10px;"></td>
  7. </tr>
  8. </table>
  9. <?PHP
  10. if (isset($_POST['edit'])) {
  11. if (empty(($_POST['surname'] || $_POST['town'] || $_POST['bday'] || $_POST['bmonth'] || $_POST['byear'] || $_POST['zodiac_sign'] || $_POST['nickname'] || $_POST['artists'] || $_POST['movie'] || $_POST['favgroup'] || $_POST['dream'] || $_POST['freetime'] || $_POST['saying']))) {
  12. ?>
  13. alle velden moeten ingevuld worden!
  14. <?PHP
  15. } else {
  16. mysql_query("UPDATE admins SET surname='".addslashes($_POST['surname'])."', town='".addslashes($_POST['hometown'])."', bday='".addslashes($_POST['bday'])."', bmonth='".addslashes($_POST['bmonth'])."', byear='".addslashes($_POST['byear'])."', sign='".addslashes($_POST['zodiacsign'])."', nick='".addslashes($_POST['nickname'])."', artists='".addslashes($_POST['artists'])."', movie='".addslashes($_POST['movie'])."', favgroup='".addslashes($_POST['favgroup'])."', dream='".addslashes($_POST['dream'])."', freetime='".addslashes($_POST['freetime'])."', saying='".addslashes($_POST['saying'])."'") or die(mysql_error());
  17. ?>
  18. gelukt..
  19. <?PHP
  20. }
  21. } elseif (isset($_POST['password'])) {
  22. $select = mysql_query("SELECT * FROM admins WHERE pass='".md5($_POST['pass1'])."'") or die(mysql_error());
  23.  
  24. if (mysql_num_rows($select) <> 0) {
  25. if ($_POST['pass1'] == $_POST['pass2']) {
  26. mysql_query("UPDATE admins SET pass='".md5($_POST['newpass'])."'");
  27. ?>
  28. gelukt...
  29. <?PHP
  30. } else {
  31. ?>
  32. beide wachtwoorden zijn niet gelijk!
  33. <?PHP
  34. }
  35. } else {
  36. ?>
  37. wachtwoord is niet correct!
  38. <?PHP
  39. }
  40. } else {
  41. $select = mysql_query("SELECT * FROM admins WHERE name='".$_SESSION['suser']."'");
  42. $data = mysql_fetch_array($select);
  43.  
  44. $name = $data['name'];
  45. $surname = stripslashes($data['surname']);
  46. $nickname = stripslashes($data['nick']);
  47. $zodiacsign = stripslashes($data['sign']);
  48. $hometown = stripslashes($data['town']);
  49. $artists = stripslashes($data['artists']);
  50. $movie = stripslashes($data['movie']);
  51. $favgroup = stripslashes($data['favgroup']);
  52. $freetime = stripslashes($data['freetime']);
  53. $dream = stripslashes($data['dream']);
  54. $saying = stripslashes($data['saying']);
  55. ?>
  56. <table width="98%" class="font" cellpadding="0" cellspacing="0" align="center" style="border: none; border-collapse: collapse;">
  57. <tr>
  58. <td valign="middle" style="background-color: #FFFFFF; border: 1px solid #666666; padding: 2pt 3.5pt 2pt 3.5pt;">
  59. <table width="100%" class="font" cellpadding="0" cellspacing="2" align="center" style="border: none; border-collapse: collapse;">
  60. <form name="form" method="post" action="<?PHP $_SERVER['PHP_SELF']; ?>">
  61. <tr>
  62. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Name:</td>
  63. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="name" class="input" maxlength="50" value="<?= $name; ?>" disabled></td>
  64. </tr>
  65. <tr>
  66. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Surname:</td>
  67. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="surname" class="input" maxlength="50" value="<?= $surname; ?>"></td>
  68. </tr>
  69. <tr>
  70. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Nickname:</td>
  71. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="nickname" class="input" maxlength="50" value="<?= $nickname; ?>"></td>
  72. </tr>
  73. <tr>
  74. <td colspan="2" style="height: 10px;"></td>
  75. </tr>
  76. <tr>
  77. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Birth Date:</td>
  78. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt">
  79. <select name="bday" class="font">
  80. <option value="">Day</option>
  81. <option value="">- - - - - - -</option>
  82. <?PHP
  83. $your = $data['bday'];
  84. $choice = array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31');
  85. foreach ($choice as $value) {
  86. if ($value == $your) {
  87. $selected = " SELECTED";
  88. } else {
  89. $selected = "";
  90. }
  91. echo "<option value=".$value.$selected.">".$value."</option>";
  92. }
  93. ?>
  94. </select>
  95. &nbsp;
  96. <select name="bmonth" class="font">
  97. <option value="">Month</option>
  98. <option value="">- - - - - - -</option>
  99. <?PHP
  100. $your = $data['bmonth'];
  101. $choice = array('January','February','March','April','May','June','July','August','September','October','November','December');
  102. foreach ($choice as $value) {
  103. if ($value == $jouw) {
  104. $selected = " SELECTED";
  105. } else {
  106. $selected = "";
  107. }
  108. echo "<option value=".$value.$selected.">".$value."</option>";
  109. }
  110. ?>
  111. </select>
  112. &nbsp;
  113. <select name="byear" class="font">
  114. <option value="">Year</option>
  115. <option value="">- - - - - - -</option>
  116. <?PHP
  117. for($y = date('Y'); $y >= 1900; $y--)
  118. {
  119. ?>
  120. <option value="<?= $y; ?>"<?= ($data['byear'] == $y ? " selected=\"selected\"" : "") ?>><?= $y; ?></option>
  121. <?PHP
  122. }
  123. ?>
  124. </select>
  125. </td>
  126. </tr>
  127. <tr>
  128. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Zodiac Sign:</td>
  129. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="zodiacsign" class="input" maxlength="50" value="<?= $zodiacsign; ?>"></td>
  130. </tr>
  131. <tr>
  132. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Hometown:</td>
  133. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="hometown" class="input" maxlength="50" value="<?= $hometown; ?>"></td>
  134. </tr>
  135. <tr>
  136. <td colspan="2" style="height: 10px;"></td>
  137. </tr>
  138. <tr>
  139. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">These artists inspired me:</td>
  140. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="artists" class="input" maxlength="200" value="<?= $artists; ?>"></td>
  141. </tr>
  142. <tr>
  143. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Favorite Movie:</td>
  144. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="movie" class="input" maxlength="200" value="<?= $movie; ?>"></td>
  145. </tr>
  146. <tr>
  147. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Favorite Group(s)/Artist(s):</td>
  148. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="favgroup" class="input" maxlength="200" value="<?= $favgroup; ?>"></td>
  149. </tr>
  150. <tr>
  151. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Favorite thing to do in free time:</td>
  152. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="freetime" class="input" maxlength="200" value="<?= $freetime; ?>"></td>
  153. </tr>
  154. <tr>
  155. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Dream:</td>
  156. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="dream" class="input" maxlength="200" value="<?= $dream; ?>"></td>
  157. </tr>
  158. <tr>
  159. <td colspan="2" style="height: 10px;"></td>
  160. </tr>
  161. <tr>
  162. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt;">Favorite Saying:</td>
  163. <td valign="middle" style="height: 15px; padding: 2pt 3.5pt 2pt 3.5pt"><input type="text" name="saying" class="input" maxlength="50" value="<?= $saying; ?>"></td>
  164. </tr>
  165. <tr>
  166. <td colspan="2" style="height: 10px;"></td>
  167. </tr>
  168. <tr>
  169. <td width="50%" valign="middle" style="padding: 2pt 3.5pt 2pt 3.5pt;"><input type="submit" name="edit" value="Edit" class="submit"></td>
  170. <td width="50%" valign="middle" style="padding: 2pt 3.5pt 2pt 3.5pt;"><input type="reset" value="Reset" class="submit"></td>
  171. </tr>
  172. </form>
  173. </table>
  174. </td>
  175. </tr>
  176. </table>
  177. <?PHP
  178. }
  179. ?>


Iemand een opslossing? 

die form van wachtwoord moet ik nog maken, maar zonder dat moet hij de rest toch wel laten zien?

4 antwoorden

Gesponsorde links
Offline marten - 10/10/2005 21:51
Avatar van marten Beheerder begin eens met de normale html codes 
<html>
<head>
</head>
<body>
enz
Offline Xzero - 10/10/2005 21:51
Avatar van Xzero PHP beginner ik include hem, dus die <html> etc. staat in een ander document...
Offline marten - 10/10/2005 21:52
Avatar van marten Beheerder ok ff verder kijken 
Offline Xzero - 10/10/2005 22:00
Avatar van Xzero PHP beginner Sorry, ik heb het al, er zat gewoon een DIKKE fout in mijn script 

Mijn fout:
  1. <?PHP
  2. if (isset($_POST['edit'])) {
  3. if (empty(($_POST['surname'] || $_POST['town'] || $_POST['bday'] || $_POST['bmonth'] || $_POST['byear'] || $_POST['zodiac_sign'] || $_POST['nickname'] || $_POST['artists'] || $_POST['movie'] || $_POST['favgroup'] || $_POST['dream'] || $_POST['freetime'] || $_POST['saying']))) {
  4. ?>


moet zijn:

  1. <?PHP
  2. if (isset($_POST['edit'])) {
  3. if (empty($_POST['surname']) || empty($_POST['town']) || empty($_POST['bday']) || empty($_POST['bmonth']) || empty($_POST['byear']) || empty($_POST['zodiac_sign']) || empty($_POST['nickname']) || empty($_POST['artists']) || empty($_POST['movie']) || empty($_POST['favgroup']) || empty($_POST['dream']) || empty($_POST['freetime']) || empty($_POST['saying'])) {
  4. ?>


Topic kan gesloten worden...
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.206s