本文整理汇总了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();