- Messages
- 5,257
- Reaction score
- 97
- Points
- 48
I have the following code:
It doesn't work. It passes the stuff and validates it, but doesn't do anything with it.
It powers the page at http://paperforum.x10hosting.com/links
Thanks if you can help.
Code:
if(isset($_GET['ob']) && isset($_GET['o']) && (($_GET['o'] == "asc") || ($_GET['o'] == "d")) && (($_GET['ob'] == "name") || ($_GET['ob'] == "added") || ($_GET['ob'] == "date")))
{
$sql = "SELECT * FROM `Links_links` ORDER BY `" . $_GET['ob'] . "` ";
if($_GET['o'] == "asc"){
$sql .= "asc";
}
}else{
echo "ERROR";
$sql = "SELECT * FROM `Links_links` ORDER BY `Name` ASC";
}
$result = mysqli_query($cxn,$sql) or die("SQL failed");
$num = 1;
while ($row = mysqli_fetch_array($result))
{
extract($row);
echo "<a href=\"$Link\"><b>$Name</b></a><br /><p>$Description</p><p style=\"font-size:7pt\">Added by $added at $Date</p><br />";
$num++;
}
It doesn't work. It passes the stuff and validates it, but doesn't do anything with it.
It powers the page at http://paperforum.x10hosting.com/links
Thanks if you can help.