Revision 365
Added by ryan almost 18 years ago
trunk/wb/htpage.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// Include config file |
|
4 |
require_once('config.php'); |
|
5 |
|
|
6 |
// Check if specific page requested |
|
7 |
if(isset($_GET['page'])) { |
|
8 |
// Page link |
|
9 |
$page_link = addslashes($_GET['page']); |
|
10 |
// Query database |
|
11 |
$sql = "SELECT * FROM pages WHERE link = '/".$page_link."'"; |
|
12 |
$query = $database->query($sql); |
|
13 |
// Check for errors |
|
14 |
if($database->is_error()) { |
|
15 |
// Print error |
|
16 |
die($database->get_error()); |
|
17 |
} elseif($query->numRows() > 0) { |
|
18 |
// Get page id |
|
19 |
$page = $query->fetchRow(); |
|
20 |
$page_id = $page['page_id']; |
|
21 |
unset($page); |
|
22 |
// Include main script |
|
23 |
require_once('index.php'); |
|
24 |
} |
|
25 |
} |
|
26 |
|
|
27 |
?> |
|
0 | 28 |
trunk/wb/.htaccess | ||
---|---|---|
1 |
RewriteEngine on |
|
2 |
RewriteRule ^(.*).html$ htpage.php?page=$1 |
|
0 | 3 |
Also available in: Unified diff
Added new script that could possibly be apart of 2.7.x as a replacement for having the pages directory