Exemplo n.º 1
0
<?php

header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
require '../includes/classes/class.content.php';
//create the connection object
$conn = new Content("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511");
//query the database and pull the results
//select everything from the information table
echo $results = $conn->content("SELECT * FROM settings");
$conn->close();
Exemplo n.º 2
0
 public static function prepend($x)
 {
     self::$content = $x . self::$content;
 }
<?php

header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
require 'includes/classes/class.content.php';
//create the connection object
$conn = new Content("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511");
//query the database and pull the results
//select everything from the information table
echo $results = $conn->content("SELECT * FROM pages ORDER BY position");
Exemplo n.º 4
0
<?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 {
        if (isset($_GET['page'])) {
            //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");
        } else {
            //query the database and pull the results
            //select everything from the information table
            echo $conn->content("SELECT ID, contentTitle FROM information ORDER BY ID DESC");
        }
    }
}
$conn->close();
Exemplo n.º 5
0
<?php

header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
//require the content building class
require '../includes/classes/class.content.php';
//create the connection object
$conn = new Content("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511");
//select all from Carousel and convert to json
echo $conn->content("SELECT * FROM carousel ORDER BY ID");
//close the connection
$conn->close();
Exemplo n.º 6
0
<?php

header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
//require the content building class
require 'includes/classes/class.content.php';
//create the connection object
$conn = new Content("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511");
//select all from Carousel and convert to json
echo $conn->content("SELECT * FROM carousel");
//close the connection
$conn->close();