Creating a HTML list using PHP

Alles, was PHP betrifft, kann hier besprochen werden.

Creating a HTML list using PHP

Postby estudiante » 12. May 2009 10:46

Hi,

I´m trying to learn PHP and would like to solve the next problem: I would like to display a list of items (navigation list with links like "home", "about us", etc.). Can anyone tell me what I have to do? I´m not asking for code or for detail information but I´d like to have a guide of what I have to do.

I would say, first of all, I need a principal HTML-file where the list is going to be displayed. The linked files must also exist (I mean something like home.html, aboutus.html, etc). There is certainly a way to manage the list of the linked files dynamicly with PHP...

Thanks a lot for any help.
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Creating a HTML list using PHP

Postby gregor171 » 19. May 2009 18:05

First you create nested array (this would give you a list):

$link
Code: Select all
s = array(
array("title"=>"home", "url"=>"www", "image_source"=>"www.location.com/myimage.gif"),
array("title"=>"about", "url"=>"www", "image_source"=>"www.location.com/myimage.gif"),
);

To give you an idea, what to put inside.

Red some about array's: http://www.php.net/array

Then you create foreach loop and echo your content by puting it into a string.

Menu could be <table> (old way), <ul><li> - todays practice.
inside you put links:
<a href="...

image button could be also good for practice...
gregor171
 
Posts: 1
Joined: 19. May 2009 17:53

Re: Creating a HTML list using PHP

Postby NicolasPaul » 29. June 2009 11:29

Good topic.I would say, first of all, I need a principal HTML-file where the list is going to be displayed. The linked files must also exist (I mean something like home.html, aboutus.html, etc). There is certainly a way to manage the list of the linked files dynamicly with PHP...



Career Search
NicolasPaul
 
Posts: 2
Joined: 27. June 2009 12:45

Re: Creating a HTML list using PHP

Postby noeal11 » 09. October 2009 11:51

As the above member said dat he needs a Principle HTML file......like him also i too need a Principle HTML file where the list is going to be displayed.
Nice information provided by NicolasPaul...
noeal11
 
Posts: 1
Joined: 09. October 2009 11:45


Return to PHP

Who is online

Users browsing this forum: No registered users and 3 guests