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

breaking a text file into paragraphs based on strings
I have a text file of email addresses that is all squished together. It looks like this:

abc

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

CRM?
I think that's what they're called. Customer Management System? Anyway. Is there any good free ones

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would

Create comparison matrix?
I want to create a comparison script for forum software and was wondering is there any tutorial or b

MySQL query problem
When I try to run the following piece of code, I get this error:
QuoteWarning: mysql_query(): sup

Gantt Chart Tool
Does anyone know of a good free gantt chart creator tool

Thanks

How to update this array?
I am saving a string that looks this: username1, username2, username3...
into a single cell in a

Form help: Syntax & Logic
Hello again all,

I'm working on a form and ran into a wall (again) and can't seem to think th

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