PHP Classes

File: uploady/admin/pages/actions/add.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Uploady PHP Upload File to MySQL   uploady/admin/pages/actions/add.php   Download  
File: uploady/admin/pages/actions/add.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Uploady PHP Upload File to MySQL
Store file upload details in a MySQL database
Author: By
Last change: refactor
Code refactor
update permission to 755
Date: 5 months ago
Size: 482 bytes
 

Contents

Class file image Download
<?php

include_once '../../session.php';

$loclizer = new Uploady\Localization($db);

$utils = new Uploady\Utils($db);

if (
$_SERVER['REQUEST_METHOD'] == 'POST') {
    if (!
$auth->checkToken($_POST['csrf'], $_SESSION['csrf'])) {
       
$utils->redirect(SITE_URL . "/admin/pages/view.php?msg=csrf");
    }

   
$slug = $_POST['slug'];
   
$page = new Uploady\Page($db, $loclizer);
   
$page->add($slug);

   
$utils->redirect(SITE_URL . "/admin/pages/view.php?msg=page_created");
}