Repository navigation
Expand file tree
/
Copy pathevent_process.php
More file actions
50 lines (43 loc) · 1.46 KB
/
Copy pathevent_process.php
File metadata and controls
50 lines (43 loc) · 1.46 KB
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
require_once 'config.php';
/*
if(!isset($_COOKIES["user"])){
header("location: account.php");
}*/
//Inserisco
$eventTitle = $_POST["eventTitle"];
$eventDescription = $_POST["eventDescription"];
$eventPrice = $_POST["eventPrice"];
$eventPlaces = $_POST["eventPlaces"];
$eventAddress = $_POST["eventAddress"];
$eventDay = $_POST["eventDay"];
$autore = $_COOKIE["user"];
$eventCategory = $_POST["category"];
$via = $_POST["via"];
$civ = $_POST["civ"];
$cap = $_POST["cap"];
$cit = $_POST["cit"];
$stat = $_POST["stat"];
/*$via = "roma";
$civ = "55";
$cap = "65010";
$cit = "montesilvano";
$stat = "italia";*/
echo $via.$civ.$cap.$cit.$stat;
list($result, $msg) = uploadImage(UPLOAD_DIR, $_FILES["eventImg"]);
if($result != 0){
$place = $dbh->insertPlace($via, $civ, $cap, $cit, $stat);
echo $place;
$imgarticolo = $msg;
$descrizione_breve = "L'evento si terrà a ".$cit." il ".$eventDay;
$id = $dbh->insertArticle($eventTitle, $autore, $place, $eventDay, $eventCategory, $imgarticolo, $eventDescription, $descrizione_breve, $eventPrice);
if($id!=false){
$msg = "Inserimento completato correttamente!";
}
else{
$msg = "Errore in inserimento!";
}
}
setcookie("alert", $msg, time() + (86400 * 30), "/");
header("location: account.php");
?>