-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinsertpicnic.php
79 lines (69 loc) · 1.83 KB
/
insertpicnic.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
include('init.php');
if(isset($_POST['title'])){
$title=$_POST['title'];
$Places=$_POST['Places'];
$activities=$_POST['activities'];
$food=$_POST['food'];
$yt1=$_POST['yt1'];
$mt1=$_POST['mt1'];
$dt1 =$_POST['dt1'];
$st1=$yt1.$mt1.$dt1;
$date1=date('Y-m-j',strtotime($st1));
$yt2=$_POST['yt2'];
$mt2=$_POST['mt2'];
$dt2=$_POST['dt2'];
$st2=$yt2.$mt2.$dt2;
$date2=date('Y-m-j',strtotime($st2));
$yt3=$_POST['yt3'];
$mt3=$_POST['mt3'];
$dt3=$_POST['dt3'];
$st3=$yt3.$mt3.$dt3;
$date3=date('Y-m-j',strtotime($st3));
$transportation=$_POST['transportation'];
$priceperperson=$_POST['priceperperson'];
$children=$_POST['children'];
$disability=$_POST['disability'];
$baby=$_POST['baby'];
$capacity=$_POST['capacity'];
$Contracts=$_POST['Contracts'];
$query="INSERT INTO `picnics`(
picnics.title,
picnics.place,
picnics.activities,
picnics.food,
picnics.`depature time`,
picnics.`arrive time`,
picnics.`return time`,
picnics.transportation,
picnics.priceperperson,
picnics.ischildren,
picnics.isdisability,
picnics.isbaby,
picnics.capacity,
picnics.contractid)
VALUES ('".mysql_real_escape_string($title)
."','".mysql_real_escape_string($Places).
"','".mysql_real_escape_string($activities).
"','".mysql_real_escape_string($food).
"','".mysql_real_escape_string($date1).
"','".mysql_real_escape_string($date2).
"','".mysql_real_escape_string($date3).
"','".mysql_real_escape_string($transportation).
"','".mysql_real_escape_string($priceperperson).
"','".mysql_real_escape_string($children).
"','".mysql_real_escape_string($disability).
"','".mysql_real_escape_string($baby).
"','".mysql_real_escape_string($capacity).
"','".mysql_real_escape_string($Contracts)."' );";
echo $query;
if($query_run=mysql_query($query))
{
ob_start();
header('Location: mainpage2.php');
exit;
}
}
require('globalvar.php');
?>
<a href="<?php $_SESSION['previous_page']?>">Previous Page</a>