-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathn1.php
35 lines (26 loc) · 805 Bytes
/
n1.php
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
<?PHP
include "header.php";
include("connect.php");
if(!isset($_SESSION['usr']))
{
header('location:login.php');
}
mysql_connect("localhost","root","") or die('Error in connection');
mysql_select_db('mail') or die('No Database Found');
$fileName = $_FILES['p']['name'];
$tmpName = $_FILES['p']['tmp_name'];
move_uploaded_file($_FILES['p']['tmp_name'],'tmp/'.$_FILES['p']['name']);
$path='tmp/'.$fileName;
if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
$uname=$_SESSION["usrid"];
$qs = "select * from userdetail Where email='$uname';";
$res = mysql_query($qs);
$ff = mysql_fetch_array($res);
$qs1 = "update userdetail SET name='$path' Where email='$uname';";
$res1 = mysql_query($qs1);
$_SESSION['em']="set successfully.";
header('location:viewprofile.php');
?>