-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajaxresform.php
45 lines (40 loc) · 1.16 KB
/
ajaxresform.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
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$adult = $_POST['adult'];
$child = $_POST['child'];
$checkin_date = $_POST['checkin_date'];
$checkout_date = $_POST['checkout_date'];
$tour_selection = $_POST['tour_selection'];
$reservation_message = $_POST['reservation_message'];
if ($phone == null or $phone == '') {
echo json_encode([
'status'=>0,
'message'=>'basarısız'
]);
} elseif ($email == null or $email= '') {
echo json_encode([
'status'=>2,
'message'=>'basarısızemail'
]);
} else {
$dosyaya_baglanti = fopen('tourreservation.html',"a+");
$yenimail= '<br>name:'.$name.
'<br>email:'.$email.
'<br>phone:'.$phone.
'<br>adult:'.$adult.
'<br>child:'.$child.
'<br>checkin date:'.$checkin_date.
'<br>checkout date:'.$checkout_date.
'<br>tour selection:'.$tour_selection.
'<br>reservation message:'.$reservation_message.
'<hr>';
$dosya = fwrite($dosyaya_baglanti,$yenimail);
fclose ($dosya);
echo json_encode([
'status'=>1,
'message'=>'basarılı'
]);
}
?>