-
Notifications
You must be signed in to change notification settings - Fork 0
/
test 1 - script.php
28 lines (22 loc) · 997 Bytes
/
test 1 - script.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
<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
require('includes/classes/class.content.php');
$page = htmlspecialchars($_GET['page'], ENT_QUOTES);
$id = htmlspecialchars($_GET['id'], ENT_QUOTES);
//create the connection object
$conn = new Content("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511");
if (isset($_GET['page']) and $page == "index"){
//this is the index page will be used to show recent examples
echo $conn->content("SELECT * FROM information WHERE display<>1 ORDER BY ID DESC");
}else{
if (isset($_GET['id'])) {
//query the database and pull the results
//select everything from the information table
echo $conn->content("SELECT * FROM information WHERE ID=$id");
}else{
//query the database and pull the results
//select everything from the information table
echo $conn->content("SELECT * FROM information WHERE page='$page' ORDER BY ID DESC");
}
}