forked from blabla1337/skf-workshop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
loggedin.php
executable file
·45 lines (35 loc) · 1.28 KB
/
loggedin.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
<?php
ob_start();
session_start();
if($_SESSION['access'] != "active"){
if($_SESSION['access'] == ""){
header("location:login.php");
}
}
$db = new PDO('mysql:host=localhost;dbname=test;charset=utf8', 'root', 'root');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$stmt = $db->prepare("SELECT * FROM pages WHERE userID=?");
$stmt->execute(array($_GET['userID']));
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($rows as $info){
$text = $info['text'];
}
?>
<?php include('includes/menu.php'); ?>
<?php include('includes/sidebar.php'); ?>
<div id="content">
<h1>You have been authenticated</h1>
<h4>Update your page information!</h4>
<br/>
<?php echo $text; ?>
<br/><br/><br/><br/>
<form action="submitted.php?userID=<?php echo $_GET['userID']; ?>" method="post">
<div class="form_settings">
<p><span>My information:</span><textarea class="contact textarea" rows="8" cols="50" name="your_enquiry"><?php echo $text; ?></textarea></p>
<p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="update" value="submit" /></p>
</div>
</form>
</div>
</div>
<?php include('includes/footer.php');