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.

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 Like 51 Dislike
Previous forums Next forums
Other forums

Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an

error reporting
hey everyone

I have a production server in which I want error reporting but only on some page

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

Somebody hacked into my site and changed coding >>> URGENT HELP NEEDED <<<
I am not that much into programming , but somebody is hacking to my site and injecting some kind of

IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with

very easy question about SQL info
Hello,
I think that I have a very easy question.
I know how to create a form using php SQL and

Image DPI
Hi.

I allow users to upload images, the user then is able to adjust several settings for the

serializing objects - loses methods - the point being?
Hi

I know that serializing an object will lose the methods. But whats the point in that? What

Inter Company -- Resources Related Billing (Services Industry)
Hello,

My company has a scenario where:
Company A bills Company C for INTER (cross

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash