-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp_code.php
More file actions
26 lines (23 loc) · 755 Bytes
/
php_code.php
File metadata and controls
26 lines (23 loc) · 755 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
<?php
$servername = "localhost";
$username = "root";
$password = "akash";
$dbname = "kuttart";
try {
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "UPDATE users
SET username='".$_POST["Name"]."',city= '".$_POST["City"]."',address='".$_POST["Address"]."',country='".$_POST["Country"]."',password='".$_POST["psw"]."',pin='".$_POST["Pin"]."'
WHERE email = '".$_POST["email"]."'";
// use exec() because no results are returned
$conn->exec($sql);
header('Location: user.php');
exit;
}
catch(PDOException $e)
{
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
?>