How to create a static html menu from a database
Posted on
16th Feb 2014 07:03 pm by
admin
Hi,
I have built a small cms which allows me to create simple html pages and then upload them to an ftp.
Did you know?Explore Trending and Topic pages for more stories like this.
Everything is working apart from the menu, I cant get my head round how to create the menu system. The outputted file is a static html file that wont be connected to a database, so I need to retrieve the information from the database then write this information in standard html to a page before it is sent to the ftp.
I have looked through the forum and the net and can't find a solution, can anyone help?
CODE//// (which I know is incorrect, but kind of works and should hopefully show what I mean)
$page_name = mysql_query("SELECT * FROM pages WHERE page_display = 'yes' ORDER BY page_order ASC")
or die(mysql_error());
while($info = mysql_fetch_array( $page_name ))
{
$page[] = $info[page_name];
}
$navigation = <<<EOD
<li>$page[0]</li>
<li>$page[1]</li>
<li>$page[2]</li>
<li>$page[3]</li>
EOD;
No comments posted yet
Your Answer:
Login to answer
170
51
Other forums
php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th
Troubles with a spider class
I am building a spider that will crawl through random whitepages (eg. anywho.com, switchboard.com, w
question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or
tag inside php... hi
Code: <?php echo "<td width="$columnWidth%" align=&Mail Script Problems I have created a PHP mail script. I am having a problem though. In $body i am trying to put two va restricting another login once you logout Hello,
how can I restrict a page from login authenticating against info in a MySQL DB for a s XML Grouping I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h need help with this contact form I made this form and I need it to read the data and write the data to a table and its not working ca delete comma HI,
How to delete "," at the end of the string. Code: $match = 2009/02/03/a2corr Comparing MySql data and arrays. I have a mysql table set up like this: idsubjectbodyuseriddatetimetags1blog subjectblog body111|2
|