-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsave.php
More file actions
22 lines (20 loc) · 964 Bytes
/
Copy pathsave.php
File metadata and controls
22 lines (20 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
if (($_POST['submitbutton'])){ //if the button has been pressed
if( ($_POST['name'])&&($_POST['tickets'])&&(isset($_POST['start']))&&(isset($_POST['end']))){ //if not empty
$name=$_POST['name'];
$tickets=$_POST['tickets'];
$start=$_POST['start'];
$end=$_POST['end'];
$posts = "{$name} {$tickets}{$start}{$end}";
if ( ( (int)$tickets == $tickets && (int)$tickets > 0 )){ // if not integer and not positive
file_put_contents("records.dat", $posts . file_get_contents('records.dat') );
include("index.php");
}else{
echo "<script>alert('Insert a valid number');</script>";
include("index.php");
}
}else{
echo "<script>alert('Complete all the fields.');</script>";
}
}
?>