Hi All,
Can someone tell my how I can make this work:
I have subjects AND pages from the Database.
I am in this small script deciding which link is set, a subject or a page.
Also I am showing the relevant pages under each subject, by ordering the pages like this:
$sqlCommand = "SELECT * FROM pages WHERE subjectid='" . $subjectid . "' AND showing='1' ORDER BY pos ASC";
As you can see below, when a subject is set, a page is NUll.
When a page is set, a subject is NULL.
The problem is, that the page navigation only is visible when a subject is set.
So what happens when I click a subject is: The relevant page navigation shows up = Perfect! Then I click a page, and Then the page navigation is GONE, Because then i have set a page, and that means in my script that the subject is unset, right..And when I only show the page when a subject is set, the navigation dissapears! Do you follow me....
I want to write this so when a subject is set, the relevant pages/links appears, and then I want the pages/links to stay there after one of them has been clicked.
Now, they dissappear...
Script:
if (isset($_GET['sid'])) {
$subjectid = ($_GET['sid']);
$pageid = NULL;
$subjectid = preg_replace("[^0-9]", "", $_GET['sid']); // filter everything but numbers for security
} elseif (isset($_GET['pid'])){
$subjectid = NULL;
$pageid = ($_GET['pid']);
$pageid = preg_replace("[^0-9]", "", $_GET['pid']); // filter everything but numbers for security
} else {
$subjectid = '1';
$pageid = NULL;
}