-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
164 lines (128 loc) · 6.9 KB
/
main.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
session_start();
include 'DBConn.php';
include 'comment.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Main</title>
<script type="text/javascript" src="login_signup.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>-->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="Text/css" href="mainPage.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Create an account</h2>
<form id="myForm" role="form" method="post" >
<input type="text" class="inputfield" id="first_name" name="first" placeholder="First Name">
<p id="first" class="validation_error">p</p>
<input type="text" class="inputfield" id="last_name" name="last" placeholder="Last Name">
<p id="last" class="validation_error">p</p>
<input type="email" class="inputfield" id="emails" name="Email" placeholder="Email" >
<p id="email" class="validation_error">p</p>
<input type="password" class="inputfield" id="passwords" name="pwd" placeholder="Password">
<p id="password" class="validation_error">p</p>
<button type="button" class="signupb" id="signUp_button" name="submit" onclick="validate()">SIGN UP</button>
</form>
</div>
</div>
<div id="main_container">
<div id="head">
<div id="logo">
</div>
<div id="login-signup-container">
<div id="login-content">
<?php
if(isset($_SESSION['first'])){
echo $_SESSION['first'].'<form action="logout.php">
<button type="submit">LogOut</button>
</form>' ;
}
else{
echo '<form id="form" action="login.php" method="POST">
<input class="lg-pwd-text" type="text" name="Email" placeholder="Email" >
<input class="lg-pwd-text" type="password" name="pwd" placeholder="Password" >
<input class="login-button" type="submit" name="submit" value="Login">
</form>'
;
echo '<button class="signup" id="sign" onclick="display()">SIGN UP</button>';}
?>
</div>
</div>
</div>
<div id="container">
<div id="content">
<div id="content-head">
<ul>
<li><a id="categories">Content</a></li>
<li><a id="feedback-button" >Feedback</a></li>
<li><a id="about-button">About</a></li>
</ul>
</div>
<div id="category-div">
<div id="category-content">
<ul>
<li>
<a class="categ" href="categories.php?id=shopping" >Shopping</a>
</li>
<li>
<a class="categ" href="categories.php?id=news" >News</a>
</li>
<li>
<a class="categ" href="categories.php?id=College" >College</a>
</li>
<li>
<a class="categ" href="categories.php?id=Hospital" >Hospital</a>
</li>
<li>
<a class="categ" href="categories.php?id=Entertainment" >Entertainment</a>
<li>
<a class="categ" href="categories.php?id=Educational" >Educational</a>
</li>
<li>
<a class="categ" href="categories.php?id=Banking" >Banking</a>
</li>
<li>
<a class="categ" href="#" >Category8</a>
</li>
<li>
<a class="categ" href="#" >Category9</a>
</li>
<li>
<a class="categ" href="#" >Category10</a>
</li>
</ul>
</div>
</div>
<div id="feedback-div">
<div id="feedback-content">
<?php
if(isset($_SESSION['Email'])){
echo '<form action="'.setcomment($conn).'" method="POST" >
<input type="hidden" name="Email" value="'.$_SESSION['Email'].'">
<input type="hidden" name="date" value="'.date('y-m-d H:i:s').'">
<textarea name="msg" id="textarea" type="text" placeholder="Feedback" ></textarea>
<input type="submit" class="feedback-submit" name="submit" value="SUBMIT">
</form>';
}
else{
echo 'Your are not logged in!';
}
getcomment($conn);// for geeting comments
?>
</div>
</div>
<div id="about-div">
<h1 >About</h1>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="login_signup.js"></script>
</body>
</html>