Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

generate_delete_link.php 933B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. include('../includes/config.php');
  3. if(isset($_POST) && isset($_SESSION))
  4. {
  5. $file = rawurldecode($_POST['uploadID']);
  6. if (isset($_SESSION[$file]) && $_SESSION[$file] == $file)
  7. {
  8. $file_db = $db->select('uploads', "url=? LIMIT 1", array($file));
  9. if ($file_db)
  10. {
  11. $delete_key = generate_code($file_db['url'], $CONF);
  12. $data = array(
  13. "delete_key" => $delete_key
  14. );
  15. $post_id = $db->update($data, 'uploads', 'url=?', array($file));
  16. unset($_POST);
  17. echo json_encode(array('result' => array('url' => get_page_url("u", $CONF).'/'.$file_db['url'].'/'.$delete_key)));
  18. }
  19. else
  20. {
  21. echo json_encode(array('error' => $CONF['errors']['NoFile']));
  22. }
  23. }
  24. else
  25. {
  26. echo json_encode(array('error' => $CONF['errors']['InvRequest']));
  27. }
  28. }
  29. else
  30. {
  31. echo json_encode(array('error' => $CONF['errors']['InvRequest']));
  32. }
  33. ?>