forked from keshri23jayesh/justdeliverit.in
-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect.php
35 lines (26 loc) · 997 Bytes
/
connect.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
define('DB_HOST', 'localhost');
define('DB_NAME', 'justixcl_jayesh');
define('DB_USER','justixcl_jay');
define('DB_PASSWORD','jay@123');
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
$db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
$name=$_POST['name'];
$mobile=$_POST['mob'];
$email=$_POST['email'];
$address=$_POST['address'];
$landmark=$_POST['landmark'];
$prodis=$_POST['prodis'];
$protype=$_POST['protype'];
date_default_timezone_set("Asia/Kolkata");
$time = date("h:i:sa");
$date = date("Y/m/d") ;
$query = "INSERT INTO info(name,mobile,email,address,landmark,prodis,protype,time,date) VALUES('$name','$mobile','$email','$address','$landmark','$prodis','$protype','$time','$date')";
$res = mysql_query($query) or die("Error in your query");
if($res) {
header("Location: success.php");
}
else {
echo "Error in insertion!";
}
?>