Пример #1
0
 public function fsInit()
 {
     if ($_POST['id'] != '') {
         $id = $_POST['id'];
         $del = $_POST['del'];
         $db = new SqlConnect();
         $db->sqlInit();
         $finalURL = $db->getNameById($id);
         if ($del == 'true') {
             unlink('../images/' . $finalURL);
             echo "URL: " . $finalURL . " DELETED";
             $db->updateColumn($id);
         }
         if ($del == 'false') {
             $db->addCounter($id);
             echo 'Added ++ Count';
         }
     }
 }
Пример #2
0
<?php

require 'classes/AutoLoad.php';
?>

<?php 
$db = new SqlConnect();
$db->sqlInit();
?>

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
</head>

<form action = "classes/UploadImage.php" method = "post" enctype = 'multipart/form-data'>
  <input type = "file" name = "somename" />
  <input type = "submit" value = "Загрузить" />
</form>

<script>

$(document).ready(function(){
  $("img").click(function(){
    var id = $(this).attr('id');
        $.post(
        "/classes/FileSystem.php",
        {
          id: id,
          del: false
        },