-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_idea.php
34 lines (28 loc) · 891 Bytes
/
create_idea.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
<?php require_once("includes/session.php"); ?>
<?php require_once("includes/connections.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php
$user = $_SESSION['email'];
$idea = $_POST['idea'];
$time = $_POST['time'];
$day = $_POST['day'];
$location = $_POST['location'];
$tags = $_POST['tags'];
$month = $_POST['month'];
$dayOfMonth = $_POST['dayOfMonth'];
$year = $_POST['year'];
$access = $_SESSION['email'];
$query = "INSERT INTO ideas (
user, idea, time, day, location, tags, month, dayOfMonth, year, access
) VALUES (
'{$user}', '{$idea}', '{$time}', '{$day}', '{$location}', '{$tags}', '{$month}', '{$dayOfMonth}', '{$year}', '{$access}'
)";
if (mysql_query($query, $connection)) {
header("Location: index.php?sub=successful");
exit;
} else {
header("Location: index.php?sub=booboo");
exit;
}
?>
<?php mysql_close($connection); ?>