Jump to content

Enter And Display Page Under Several Sections


son

Recommended Posts

I have a form where you can upload new data into the db to 'create' a new page on website (all on same page, simple CMS). You can select if appropriate if a page is under a main section with:

echo "<p><label for=\"parent_id\">Page is sub-page of</label><br /><select name=\"parent_id\"><option value=\"0\">Not applicable</option>";$q = 'SELECT page_id, parent_id, heading FROM cms WHERE parent_id = "0" ORDER BY heading';$r = mysqli_query($dbc, $q);$main = array();while (list($page_id, $parent_id, $heading) = mysqli_fetch_array($r, MYSQLI_NUM)) {echo "<option value=\"$page_id\">$heading</option>\n";$main[] = array ('page_id' => $page_id, 'parent_id' => $parent_id, 'heading' => $heading);}echo "</select></p>";

Now, my question: I would like to have ability to have same page under several sections if needed. This would mean I have to create a multiple select, but how do I get data in table (as an array with what data type?). Also, how do I the normal check to display links in nav? Before it was 'check if page has parent page with id = 1' and similar. If there is an array of numbers how do I check this?Thanks,Son

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...