-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsertdetails.php
More file actions
33 lines (28 loc) · 976 Bytes
/
Copy pathinsertdetails.php
File metadata and controls
33 lines (28 loc) · 976 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
<?php
session_start();
$err="";
include 'db/dbconn.php';
if(isset($_POST['submit'])){
// $query = "select * from users where name = '$name'";
// $result = mysqli_query($con, $query);
// $user_data = mysqli_fetch_assoc($result);
$u_id = $_SESSION['id'];
$platform = $_POST['platform'];
$username = $_POST['username'];
$password = $_POST['password'];
$other = $_POST['other'];
$insertquery = "INSERT INTO `details` (`id`, `u_id`, `platform`, `username`, `password`, `other`, `timestamp`)
VALUES (null, '$u_id', '$platform', '$username', '$password', '$other', current_timestamp())";
$res = mysqli_query($con,$insertquery);
if($res){
?>
<script>
location.replace("details.php");
</script>
<?php
}
else{
echo "unsuccessful";
}
}
?>