-
Notifications
You must be signed in to change notification settings - Fork 1
/
insert.php
44 lines (36 loc) · 907 Bytes
/
insert.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
36
37
38
39
40
41
42
43
44
<?php
session_start();
$sel=$_POST["sel"];
if(isset($_POST["ipu"]))
$ipu=strip_tags(trim($_POST["ipu"]));
if(isset($_POST["pwo"]))
$pwo=strip_tags(trim($_POST["pwo"]));
$userna=$_SESSION['userna'] ;
if(!empty($ipu) && !empty($pwo)){
$host="localhost";
$dbname="id7285592_kugesh";
$use="id7285592_root";
$pas="11111";
$conn=new mysqli($host,$use,$pas,$dbname);
if(mysqli_connect_error())
{
die('connect error ('.mysqli_connect_error().')');
}
else{
$ins = "INSERT INTO $sel(user,username,pass) values('$userna','$ipu','$pwo')";
//$tot=mysqli_fetch_assoc($stmt);
$res=$conn->query($ins);
//$row = $res->fetch_assoc();
if($res){
echo "Successfully Inserted";
}
else{
echo "Enter valid data";
}
$conn->close();
}
}
else{
echo "enter Username or Password";
}
?>