aboutsummaryrefslogtreecommitdiff
path: root/templates/panel.php
blob: 5c090c8d82ab4ef49c35b4482fdb2d2256dc60d9 (plain)
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
<div id='login_box'>
<?php
session_start();

if (isset($_SESSION['user_id']) && $_SESSION['user_id'] != "") {
    echo "<p>Welcome, $_SESSION[user_name] | ";
    echo "<a href='{$config['urls']['base']}/user/index.php'>account</a> | ";
    echo "<a href='{$config['urls']['base']}/user/logout.php'>logout</a></p>";
} else {
?>
<p><a href='<?php echo "{$config['urls']['base']}/user/index.php"; ?>'>sign up</a> or log in</p>
<p><form action='<?php echo "{$config['urls']['base']}/user/login.php"; ?>' method='post'>
    <input name='username' placeholder='username' type='text' required >
    <input name='password' placeholder='password' type='password' required >
    <input type='submit' value='login' >
</form>
<?php
}
?>
</div>

<form action='<?php echo "{$config['urls']['base']}/index.php"; ?>' method='get'>
    <input name="term" type="text" >
    <input type="submit" value="search" >
</form>

<p>_GET: <?php print_r($_GET); ?></p>
<p>_SESSION: <?php print_r($_SESSION); ?></p>
<hr>