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

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

Nested (echoed) php running wrong script
Got a problem with a php website I'm creating.

In a nutshell, the first page is entirely html

button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdo

socket makes browser hang...
I have a socket server, and I am having a problem at the moment...

A browser sends a http hea

unexpected T_VARIABLE error
Hey all! I'm getting an unexpected T_VARIABLE with the following function:

function getHighes

PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and edu

generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

Had a simple form script that suddenly stopped working
It was made about a year ago and had been working fine. Last time it was known to work for sure was

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