Public paste
Undefined
By: Guest | Date: Dec 2 2007 14:37 | Format: PHP | Expires: never | Size: 5.26 KB | Hits: 1296

  1. <script language="javascript" type="text/javascript">
  2. tinyMCE.init({
  3.         mode : "textareas",
  4.         theme : "advanced",
  5.         plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
  6.         theme_advanced_buttons1_add : "fontselect,fontsizeselect",
  7.         theme_advanced_buttons2_add : "separator,zoom,forecolor,backcolor,separator,",
  8.         theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
  9.         theme_advanced_buttons3_add_before : "tablecontrols,separator",
  10.         theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,insertdate,inserttime,preview",
  11.         theme_advanced_toolbar_location : "top",
  12.         theme_advanced_toolbar_align : "left",
  13.         theme_advanced_path_location : "bottom",
  14.         plugin_insertdate_dateFormat : "%Y-%m-%d",
  15.         plugin_insertdate_timeFormat : "%H:%M:%S",
  16.         extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
  17.         external_link_list_url : "example_data/example_link_list.js",
  18.         external_image_list_url : "example_data/example_image_list.js",
  19.         flash_external_list_url : "example_data/example_flash_list.js"
  20. });
  21. </script>
  22. <?php
  23.         $id = $_GET['id'];
  24.  
  25.         if (!is_numeric($id))
  26.                 $id = 1;
  27.                
  28.         $sql = mysql_query("select * from users where id = $id");
  29.         if (mysql_num_rows($sql)) {
  30.                 $row = mysql_fetch_assoc($sql);
  31.         }
  32. ?>
  33. <div id="location">
  34.     U bevindt zich hier: <a href="index.php">Webber</a> &rsaquo; <a href="index.php?section=users">Gebruikers</a> &rsaquo; <a href="index.php?section=users&amp;action=edit">Gebruiker wijzigen</a>
  35. </div>
  36. <h1>Profiel wijzigen</h1>
  37. <?php
  38.  
  39. if ($_POST['submit'])
  40. {
  41.         // USERS
  42.         $username       = $_POST['username'];
  43.         if (isset($_POST['password']))
  44.                 {
  45.                         $password = $_POST['password'];
  46.                         $password = md5($password);
  47.                         print 'IFFER';
  48.                 }
  49.                 else
  50.                 {
  51.                         $password = $row['password'];
  52.                         print 'ELSER';
  53.                 }
  54.         $email          = $_POST['email'];
  55.         $name           = $_POST['name'];
  56.         $age            = $_POST['age'];
  57.         $task           = $_POST['task'];
  58.         $phone          = $_POST['phone'];
  59.  
  60.         $username_db = escape($username);
  61.         $password_db = escape($password);
  62.         $email_db = escape($email);
  63.         $name_db = escape($name);
  64.         $age_db = escape($age);
  65.         $task_db = escape($task);
  66.         $phone_db = escape($phone);
  67.        
  68.                 mysql_query("UPDATE users SET username = $username_db, password = $password_db, email = $email_db, name = $name_db, age = $age_db, task = $task_db, phone = $phone_db WHERE id = $id");
  69.                
  70.                 print "UPDATE users SET username = $username_db, password = $password_db, email = $email_db, name = $name_db, age = $age_db, task = $task_db, phone = $phone_db WHERE id = $id";
  71.                
  72.                 //print '<div class="succes">Gebruiker succesvol gewijzigd</div><meta http-equiv="refresh" content="1;URL=index.php?section=users&amp;action=edit&amp;id='.$id.'" />';
  73.         }
  74.  
  75. ?>
  76. <form action="" method="post">
  77.     <fieldset><legend>Wijzig een gebruiker zijn gegevens</legend>
  78.        
  79.         <table class="add">
  80.             <tr>
  81.                 <th colspan="2">
  82.                 Inloggegevens
  83.                 </th>
  84.             </tr>
  85.             <tr>
  86.                 <td style="width: 20%;">Gebruikersnaam:</td>
  87.                 <td style="width: 80%;">
  88.                 <input name="username" value="<?php print $row['username']; ?>" size="30" />
  89.                 </td>
  90.             </tr>
  91.             <tr>
  92.                 <td style="width: 20%;">Wachtwoord:</td>
  93.                 <td style="width: 80%;">
  94.                 <input name="password" type="password" size="30" />
  95.                 </td>
  96.             </tr>
  97.             <tr>
  98.                 <td style="width: 20%;">E-mail:</td>
  99.                 <td style="width: 80%;">
  100.                 <input name="email" value="<?php print $row['email']; ?>" size="30" />
  101.                 </td>
  102.             </tr>
  103.             <tr>
  104.                 <th colspan="2">
  105.                 Personalia
  106.                 </th>
  107.             </tr>
  108.             <tr>
  109.                 <td style="width: 20%;">Voor- en achternaam:</td>
  110.                 <td style="width: 80%;">
  111.                 <input name="name" value="<?php print $row['name']; ?>" size="30" />
  112.                 </td>
  113.             </tr>
  114.             <tr>
  115.                 <td style="width: 20%;">Leeftijd:</td>
  116.                 <td style="width: 80%;">
  117.                 <input name="age" value="<?php print $row['age']; ?>" size="30" />
  118.                 </td>
  119.             </tr>
  120.             <tr>
  121.                 <td style="width: 20%;">Functie:</td>
  122.                 <td style="width: 80%;">
  123.                 <input name="task" value="<?php print $row['task']; ?>" size="30" />
  124.                 </td>
  125.             </tr>
  126.             <tr>
  127.                 <td style="width: 20%;">Telefoon:</td>
  128.                 <td style="width: 80%;">
  129.                 <input name="phone" value="<?php print $row['phone']; ?>" size="30" />
  130.                 </td>
  131.             </tr>
  132.         </table>
  133.     </fieldset>    
  134.     <fieldset><legend>Opties</legend>
  135.         <input value="opslaan" name="submit" type="submit" class="button" />&nbsp;
  136.         <input value="annuleren" type="submit" onclick="javascript:history.back()" class="button" />
  137.     </fieldset>
  138.        
  139.         </form>