PHP Classes

File: uploady/actions/reportabuse.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Uploady PHP Upload File to MySQL   uploady/actions/reportabuse.php   Download  
File: uploady/actions/reportabuse.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: Fixea
Date: 2 months ago
Size: 920 bytes
 

Contents

Class file image Download
<?php

include_once '../session.php';

use
Uploady\Mailer;

$tpl = new Uploady\Template(APP_PATH . 'template/emails/');

$handler = new Uploady\Handler\UploadHandler($db);

if (
$_SERVER['REQUEST_METHOD'] == 'POST') {
    if (!
$handler->fileExist($_POST['fileid'])) {
       
$utils->redirect(SITE_URL . "/reportabuse.php?msg=file_not_found&file_id={$utils->sanitize($_POST['fileid'])}");
    }

   
$mailer = new Mailer($db);

   
$mailer->sendMessage(
       
$st["owner_email"],
       
"Action Required: Report Abuse - " . $utils->sanitize($_POST['fileid']),
       
$tpl->loadTemplate(
           
'report_abuse',
            [
               
'reporter' => $_POST['emailaddress'],
               
'reported_url' => $_POST['fileid'],
               
'reason' => $_POST['fileabusenote']
            ]
        )
    );

   
$utils->redirect(SITE_URL . "/reportabuse.php?msg=report_sent&file_id={$_POST['fileid']}");
}