-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.php
executable file
·29 lines (29 loc) · 1012 Bytes
/
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
<?php
include 'dbconfig.php';
session_start();
if(isset($_POST['submit'])){
$title=$_POST['title'];
$description = $_POST['description'];
$username = $_SESSION['username'];
echo $description;
$query =$database->query("INSERT INTO `notedata`(`title`, `description`,`username`) VALUES ('$title','$description','$username')");
header("Location: /noteapp/");
exit();
}
if($_SESSION['loggedin']=="yes"){
echo "
<div class=\"createtasks\">
<h1 style=\"padding-left:12px;\">Create Tasks:</h1>
<form action=\"create.php\" method=\"POST\">
<label for=\"title\">Title</label>
<input type=\"text\" name=\"title\" placeholder=\"title\">
<label for=\"description\">Description</label>
<input type=\"text\" name=\"description\" placeholder=\"description\">
<input type=\"submit\" value=\"submit\" name=\"submit\">
</form>
</div>
";}
else{
echo "<h1>Please login to continue!</h1>";
}
?>