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

PHP File Upload Problem
Hi, I have written a very simple file upload script but it fails for reasons I can't explain. Hope

help with Get_
ok some how this is not working i am not sure what i am doing wrong here but what this does is when

Include ("Absolute Path") of a file?
I'm not sure what I'm doing wrong. I am writing my php code in the same directory of the file that

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo

A Few Questions
Hi, I want to ask a few questions that I can't seem to find..

1) I'm creating a "shortcu

Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w

problem with php mysql query
Hi guy's...

I'm totally lost here..because don't have any idea how to make a query for grab r

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

Converting from one format to another
"I have got a date in DD/MM/YYYY but I need it in MM-DD-YYYY. Help!"

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