Advertisement
tjromano

update_memos

Oct 23rd, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2. session_cache_limiter();
  3. session_start();
  4. error_reporting(E_ALL);
  5. ini_set('display_errors',1);
  6.  
  7. require('config.php');
  8. require('functions.php');
  9.  
  10. //check for administrative rights
  11. if (allow_access('Administrators') != "yes")
  12. {
  13.     include ('no_access.html');
  14.     exit;
  15. }
  16.  
  17. $id_memos = $_POST['id_memos'];
  18. $memo_date = date('Y-m-d');
  19. $memo = $_POST['memo'];
  20. $memo = mysql_real_escape_string($memo);
  21. $memos_active = isset($_POST['memos_active']) && $_POST['memos_active'] == 1 ? 1:'0';
  22.  
  23. // update data in mysql database
  24. $sql="UPDATE `memos` SET memo_date='$memo_date',  memo='$memo', memos_active='$memos_active' WHERE id_memos='$id_memos'";
  25. $result=mysql_query($sql);
  26.  
  27. // if successfully updated.
  28. if($result){
  29. echo "Record Updated Successfully!";
  30. echo "<BR>";
  31. }
  32. else {
  33. echo "ERROR";
  34. }
  35.  
  36. ?>
  37. <html>
  38. <head>
  39. <meta http-equiv="refresh" content="3; url=main_menu.php" />
  40. </head>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement