-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpage3.php
61 lines (58 loc) · 1.54 KB
/
page3.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
<?php
require('connection.php');
if(isset($_REQUEST['submit'])){
$title=htmlentities($_REQUEST['title']);
$text=htmlentities($_REQUEST['text']);
$query="INSERT INTO posts(title,text) VALUES('$title','$text')";
mysqli_query($conn,$query);
mysqli_close($conn);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="./page1.css">
<title>
Alter Web Tutorials
</title>
</head>
<body>
<header>
<div class="container">
<div id="branding">
<h1><span>Alter</span> Web Tutorials</h1>
</div>
<nav>
<ul>
<li><a href="page1.php">Posts</a></li>
<li><a href="page3.php">Add Post</a></li>
<li><a href="page5.php">Login</a></li>
</ul>
</nav>
</div>
</header>
<section id="newsletter">
<div class="container">
<h2>Subscribe to our newsletter</h2>
<form>
<input type="email" name="email" placeholder="Enter your email...">
<button type="submit" class="button_1">Subscribe</button>
</form>
</div>
</section>
<section class="container">
<article class="loginform">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
Title :<br> <input class="input_1" type="name" name="title" required="necessary">
Message :<br> <textarea name="text" class="input_1" required></textarea>
<input type="submit" name="submit" class="button">
</form>
</article>
</section>
<footer>
<p>Alter Web Tutorials © 2019</p>
</footer>
</body>
</html>