content management system - PHP give a Link Label to a URL -
currently have finished cms website php, have been asked implement on wysiwyg form user permalink (varchar20), meaning user can create own page,with page body , enter permalink in case displayed on url offer "friendly url" example, if root url :
local/cms/
and there page primary key of 28 , permalink of "myfriends". page should accessible via url:
local/cms/?id=34&p=myfriends
when fetching appropriate page database ignore permalink , still search id. permalink text there seo purposes. far got :
//to build main navigation menu , gather data there------------------------------------ $sqlquery = "select id, page_title,link_label, last_modified phpland showing = '1' order page_order asc"; //$result = $db->query($query); $query = mysqli_query($myconnection,$sqlquery) or die (mysqli_error()); //to construct dynamic menu on cms $menudisplay = ''; while($row = mysqli_fetch_array($query)) { $pid = $row["id"]; $pagetitle = $row["page_title"]; $linklabel = $row['link_label']; //then variable displayed somewhere in markup offering pages created user proper id's , supposedly permalinks $menudisplay .= '<li class="active"><a href="index.php?pid=' .$pid . $linklabel .'">' . $pagetitle . '</a></li>'; } mysqli_free_result($query);
but not think compiles i'm being asked doesn't show quite exactly, question perhaps know better syntax ? tried clear possible apologize if not accomplished kindly apprecciated.
Comments
Post a Comment