Show sourcecode

The following files exists in this folder. Click to view.

Foogler_blog/pages

PAuthor.php
PCommentProcess.php
PDeleteCommentProcess.php
PDeletePost.php
PDeletePostProcess.php
PEditPost.php
PEditPostProcess.php
PErDiagramme.php
PIndex.php
PInstall.php
PInstallProcess.php
PNewPost.php
PNewPostProcess.php
PRssFeed.php
PShowPost.php
PStatistics.php
PValidate.php
login/

PAuthor.php

58 lines ASCII Windows (CRLF)
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
<?php
//----------------------
//PAuthor.php
//
//Shows page with info about chosen author
//----------------------

//-----------------------------------
//Handles GET variables
$chosenAuthor = isset($_GET['id']) ? $_GET['id'] : '';

//-----------------------------------
//Handles DB query
$mysqli = new mysqli(DB_HOSTDB_USERDB_PASSWORDDB_DATABASE); //New DB object
$tableAuthor  DB_PREFIX 'Author';

if (
mysqli_connect_error()) {
   echo 
"Connect failed: ".mysqli_connect_error()."<br>";
   exit();
}
$mysqli->set_charset("utf8");

$chosenAuthor $mysqli->real_escape_string($chosenAuthor); //Prevent SQL-injections

//--------------------
//SQL query
$query = <<<END
--
-- Gets author info
--
SELECT info FROM 
{$tableAuthor} WHERE screenname = '{$chosenAuthor}';
END;

//Performs query
$res $mysqli->query($query) or die("Could not query database" $mysqli->errno .":" $mysqli->error); 
//Gets result from query
$row $res->fetch_object();

$html = <<<END
  <h2>About {$chosenAuthor}</h2>
  <span class="post">
{$row->info}</span>
END;

$res->close();
$mysqli->close();

//-----------------------------------
//Prints HTML
require_once(TP_SOURCEPATH "CHTMLPage.php");

$page = new CHTMLPage();

$page->printHTMLHeader();
$page->printPageHeader();
$page->printPageBody($html);
$page->printTagList();
$page->printRightColumn();