-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
executable file
·51 lines (47 loc) · 1.36 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
<html lang="pl">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="main-welcome">
<h1>Witaj na blogu!</h1>
</div>
<div id="main-buttons">
<div id="log">
<p id="logowanie"><a href="login.php" id="logowanie_a">Zaloguj się</a></p>
</div>
<div id="rej">
<p id="rejestracja"><a href="rejestracja.php" id="rejestracja_a">Zarejestruj się</a></p>
</div>
</div>
<h1>WPISY</h1>
<p style="text-align:center;">Aby dodawać wpisy musisz się zalogować.</p>
<p id="old_nr" style="display:none"></p>
<p id="new_nr" style="display:none"></p>
<?php
include 'config.php';
class Wpisy
{
public function wypisz(){
global $conn;
$q='SELECT * FROM wpisy';
$result=$conn->query($q);
echo '<div id="m-table"><table>';
while($obj=$result->fetch_object())
{
echo '<tr><td>'.$obj->Nick.'</td><td>'.$obj->temat.'</td><td>'.$obj->text.'</td></tr>';
}
echo '</table></div>';
}
}
$w1=new Wpisy();
$w1->wypisz();
?>
<br/>
<footer>
<a href="https://github.com/zdinozi" target="_blank"><img src="github-ww.png" style="width: 50px; height: 50px;"></a>
<a href="https://www.linkedin.com/in/wiktor-banasiak-672425222/" target="_blank"><img src="linkedin.png" style="width: 50px; height: 50px;"></a>
</footer>
</body>
</html>