-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
menu script clean up and using content class
- Loading branch information
DoggersHusky
committed
Jan 24, 2016
1 parent
61f5219
commit ee7ffeb
Showing
2 changed files
with
4 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,11 @@ | ||
<?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 mysqli("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511"); | ||
$conn = new Content("db545467511.db.1and1.com", "dbo545467511", "Rage2167_robert", "db545467511"); | ||
|
||
//query the database and pull the results | ||
//select everything from the information table | ||
$results = $conn->query("SELECT * FROM pages ORDER BY position"); | ||
|
||
$outp = "["; | ||
|
||
while ($rs = $results->fetch_array(MYSQLI_ASSOC)) { | ||
if ($outp != "[") { | ||
$outp .= ","; | ||
} | ||
$outp .= '{"ID":"' . htmlspecialchars_decode($rs["ID"], ENT_QUOTES) . '",'; | ||
$outp .= '"pageLinkName":"' . htmlspecialchars_decode($rs["pageLinkName"], ENT_QUOTES) . '",'; | ||
$outp .= '"linkUnderPage":"' . htmlspecialchars_decode($rs["linkUnderPage"], ENT_QUOTES) . '",'; | ||
$outp .= '"page":"' . htmlspecialchars_decode($rs["page"], ENT_QUOTES) . '",'; | ||
$outp .= '"pageMenu":"' . htmlspecialchars_decode($rs["pageMenu"], ENT_QUOTES) . '",'; | ||
$outp .= '"position":"' . htmlspecialchars($rs["position"], ENT_QUOTES) . '"}'; | ||
} | ||
$outp .= "]"; | ||
|
||
|
||
|
||
$conn->close(); | ||
echo $outp; | ||
echo $results = $conn->content("SELECT * FROM pages ORDER BY position"); |