disturbedart
Member
- Messages
- 474
- Reaction score
- 1
- Points
- 18
Hello i have had a dumb moment and cant think how to do this, i have been creating a CMS at the moment and i want to be able to have pages with index.php?pid=xxx but also be able to list standard links so links to a different directory.
Does anyone got any ideas? as my current method only allows index.php?pid=xxx links
I was thinking an IF statement but cant think of how to code this in at the moment.
Possible create a new field in the database called "ext" and if this is set to 1 then it shows a directory link if set to "0" then it displays index.php?pid=xxx link. And i would set up a check box on the create/edit pages section to set this.
Any thoughts?
Thanks.
Does anyone got any ideas? as my current method only allows index.php?pid=xxx links
I was thinking an IF statement but cant think of how to code this in at the moment.
Possible create a new field in the database called "ext" and if this is set to 1 then it shows a directory link if set to "0" then it displays index.php?pid=xxx link. And i would set up a check box on the create/edit pages section to set this.
Any thoughts?
Thanks.
PHP:
//---------------------------------------------------------------------------------------------------------------------------------------------------------------
// Build Main Navigation menu and gather page data here -----------------------------------------------------------------------------
$sqlCommand = "SELECT id, linklabel FROM pages WHERE showing='1' ORDER BY id ASC";
$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error($myConnection));
$menuDisplay = '<ul>';
while ($row = mysqli_fetch_array($query)) {
$pid = $row["id"];
$linklabel = $row["linklabel"];
$menuDisplay .= '<li><a href="index.php?pid=' . $pid . '">' . $linklabel . '</a></li>';
}
$menuDisplay .= '</ul>';
mysqli_free_result($query);
//---------------------------------------------------------------------------------------------------------------------------------------------------------------
//mysqli_close($myConnection);