本文整理匯總了PHP中Content::content方法的典型用法代碼示例。如果您正苦於以下問題:PHP Content::content方法的具體用法?PHP Content::content怎麽用?PHP Content::content使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Content
的用法示例。
在下文中一共展示了Content::content方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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 settings");
$conn->close();
示例2: prepend
public static function prepend($x)
{
self::$content = $x . self::$content;
}
示例3: 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");
示例4: htmlspecialchars
<?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();
示例5: Content
<?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();