-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.php
More file actions
42 lines (35 loc) · 939 Bytes
/
Copy pathstart.php
File metadata and controls
42 lines (35 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
session_start();
$id=$_SESSION["id"];
$servername = "localhost";
$username = "root";
$password = "12345";
$db="stpro";
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
function img($fl_extn,$fl_temp){
$file_path='userimages/'.substr(md5(time()),0,10).'.'.$fl_extn;
move_uploaded_file($fl_temp,$file_path);
$_SESSION["image"]=$file_path;
}
if(isset($_SESSION["id"]))
{
$designation=$department=$name=$id="";
$id=$_SESSION["id"];
$department=$_SESSION["department"];
$designation=$_SESSION["designation"];
$name=$_SESSION["name"];
$us=$_SESSION["uname"];
$pass=$_SESSION["pass"];
}
else{
header("location:login.php");
}
if($_SESSION["image"]!=""){
$image=$_SESSION["image"];
}
?>