Skip to content

Commit

Permalink
menu script clean up
Browse files Browse the repository at this point in the history
menu script clean up and using content class
  • Loading branch information
DoggersHusky committed Jan 24, 2016
1 parent 61f5219 commit ee7ffeb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
2 changes: 1 addition & 1 deletion _notes/dwsync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<file name="test 1 - retrieving.html" server="doggershusky.com//" local="130979898554321457" remote="130979862000000000" Dst="1" />
<file name="test 1 - script.php" server="doggershusky.com//" local="130981362475451500" remote="130981326000000000" Dst="1" />
<file name="test 2 - JQuery retrieving.html" server="doggershusky.com//" local="130981367384539309" remote="130981330800000000" Dst="1" />
<file name="test 2 - menu.php" server="doggershusky.com//" local="130980597283108251" remote="130980561000000000" Dst="1" />
<file name="test 2 - menu.php" server="doggershusky.com//" local="130981372444859783" remote="130981336200000000" Dst="1" />
</dwsync>
25 changes: 3 additions & 22 deletions test 2 - menu.php
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");

0 comments on commit ee7ffeb

Please sign in to comment.