Esempio n. 1
0
 Author: Adarsh
 Purpose :
*/
if (!isset($_GET['id'])) {
    header("LOCATION: ../");
    exit;
}
session_start();
$er = FALSE;
if (!is_numeric($_GET['id'])) {
    $er = TRUE;
} else {
    $author_id = (int) $_GET['id'];
    require_once 'classes/authorClass.php';
    $newAuthor = new author();
    $authorRes = $newAuthor->getAuthorDetails($author_id);
    if (!$authorRes) {
        $er = TRUE;
    }
}
?>

<!DOCTYPE HTML>
<html>
<head>
  <title><?php 
echo $authorRes['author_name'];
?>
 | BIT UnOfficial</title>
  <meta charset="utf-8">
  <meta name="Keywords" content="BIT,Bangalore Institute Of Technology,VTU,KR Road,K.R Road,KIMS">
Esempio n. 2
0
 Project name : BITuN
 Start Date : 22 Mar, 2015 2:32:27 PM
 Author: Adarsh
 Purpose :
*/
session_start();
include 'classes/authorClass.php';
$author = new author();
$author_id = $author->authenticate();
if (!$author_id) {
    header('location:../index.php');
    exit;
}
$er = false;
$suc = false;
$result = $author->getAuthorDetails($author_id);
require_once '../include/newCon.php';
if (isset($_POST['formNo'])) {
    if ($_POST['formNo'] == 1) {
        if ($_FILES['newPic']['size'] === 0 || $_FILES['newPic']['size'] > 1000000 || $_FILES['newPic']['error'] > 0) {
            $er = true;
            $erm = "File too large/small. ";
            @unlink($_FILES['newPic']['tmp_name']);
        } else {
            $nama = explode('.', $_FILES['newPic']['name']);
            $ext = end($nama);
            $ext = strtolower($ext);
            if ($ext === "jpg") {
                array_map('unlink', glob("profile_pictures/" . $result['author_name'] . ".jpg"));
                //Delete previous fprfile pictures in the directory
                if (move_uploaded_file($_FILES['newPic']['tmp_name'], "profile_pictures/" . $result['author_name'] . ".jpg")) {