This repository has been archived by the owner on Sep 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.php
50 lines (44 loc) · 1.53 KB
/
create.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
<?php
session_start();
require dirname(__FILE__) . '/api/database.php';
//print_r($_POST);
$offset = $_POST['offset'];
$name = $_POST['name'];
$description = $_POST['description'];
$summer = $_POST['summer'];
//echo "<br>Summer is " . $summer;
//echo "<br>Offset is " . $offset;
//echo "<br>Name is " . $name;
//echo "<br>Description is " . $description;
//echo "<br>";
//echo "<br>1 is ";
//print_r(intval($offset));
//echo "<br>";
//echo gettype(intval($offset));
//echo "<br>2 is ";
//print_r($name);
//echo "<br>";
//echo gettype($name);
//echo "<br>3 is ";
//print_r($description);
//echo "<br>";
//echo gettype($description);
//echo "<br>4 is ";
//print_r(intval($_SESSION['id']));
//echo "<br>";
//echo gettype(intval($_SESSION['id']));
//echo "<br>5 is ";
//print_r("user");
//echo "<br>";
//echo gettype("user");
//echo "<br>6 is ";
//print_r(intval($summer));
//echo "<br>";
//echo gettype(intval($summer));
//echo "<br><br>Adding to database... If you don't see anything after this, that means it's failed.";
$stmt = $mysqli_conection->prepare("INSERT INTO `times` (`id`, `offset`, `name`, `description`, `creation-date`, `owner`, `type`, `summer`) VALUES (NULL, ?, ?, ?, current_timestamp(), ?, ?, ?);");
$stmt->bind_param("issisi", $a = intval($offset), $name, $description, $b = intval($_SESSION['id']), $c = "user", $d = intval($summer));
$stmt->execute();
//echo "<br>If your seeing this it was done correctly. I hope that worked lol";
//echo "<br><br><a href='times'>Go back to times</a>";
header('Location: https://timehub.hubza.co.uk/times');