-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event.php
111 lines (98 loc) · 2.63 KB
/
Event.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
$servername="localhost";
$username="root";
$password="";
$dbname="eventrova";
$event_name=$_POST["Event"];
$event_type=$_POST["Event_type"];
$location=$_POST["Location"];
$event_link=$_POST["website"];
$state=$_POST["State"];
$date=$_POST["Date"];
$description=$_POST["Description"];
$connection=mysqli_connect($servername,$username,$password,$dbname);
$query="SELECT * FROM Create_Event WHERE Event_Link='$event_link' AND Event_Name='$event_name";
$ret=mysqli_query($connection,$query);
$result=mysqli_fetch_assoc($ret);
if($result)
{
$flag=1;
}
else
{
$flag=0;
$query="INSERT INTO Create_Event (Event_Name,Event_type,Location,Event_Link,State,Event_Date,Description) values ('$event_name','$event_type','$location','$event_link','$state','$date','$description')";
$ret=mysqli_query($connection,$query);
}
?>
<!DOCTYPE html>
<html>
<head>
<style>
#Check
{
position: absolute;
top:250px;
left:550px;
color:white;
font-weight: 20px;
font-size:30px;
}
#valid
{
position: relative;
top:200px;
left:500px;
border:4px solid white;
height:300px;
width:500px;
}
#validation
{
position: relative;
top:100px;
left:680px;
height:50px;
width:200px;
font-size:25px;
background-color:Orange;
box-shadow: 0 0 5px 4px black;
}
a
{
text-decoration: none;
color:#FDFDFD;
}
</style>
<link rel="stylesheet" type="text/css" href="Login.css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<title>Login</title>
<body>
<div id="valid">
</div>
<button id="validation"><a href="Index3.html">Button</a></button>
<script>
var flag=parseInt("<?php echo $flag ?>")
if(flag==1)
{
var doc=document.createElement("P")
doc.innerHTML="Oops! itseems that you are trying to<br> create an event which has been created already"
doc.id="Check"
document.body.appendChild(doc)
var button=document.querySelector("a");
button.innerHTML="Back"
button.setAttribute("href","Event.html")
}
else
{
var doc=document.createElement("P")
doc.innerHTML="Thanks for Letting us know about the <br>event we will post this on our website<br>"
doc.id="Check"
document.body.appendChild(doc)
var button=document.querySelector("a");
button.innerHTML="Home"
}
</script>
</body>
</html>