help with php coding

Status
Not open for further replies.

nicknack

New Member
Hi,
First post so hello to everyone.

Hoping someone can help me out before i go mental. ha.

Im making a website, its a classified ads site (yes another one... buts it aim is different).

I have a script which is working fine but im having trouble with the coding.

Basically on my main page, the ads are listed. But I want to have a menu on the main page.

Basically a text menu like this:

For Rent:
Houses
Apartments
Shops etc...

I can do it in HTML but im wondering how do I do this in PHP?

Also I want to have a menu at the side, with links like Dublin, Cork, Waterford, so that when people click them ONLY ads from that area show up.

Is this a big job? The script I have is fine, but it doesnt have these features.

Hoping someone can help me or even guide me in the right place. Im learning PHP so its a bit tricky.

Thanks
 

louie

New Member
the script you are using is probably done around a database so it's a matter of making a query to the tables and get the data you need, save it into arrays and work from there.
 

jonathan11

New Member
Hi nicknack,

Just started out with php myself a few months ago, its well worth learning, can do lots of things.

Generally people use php for dynamic content.
For example if you have information stored in a database and want to present the data as a list on a webpage then php is very good at this.
For static content that does not change, e.g. menu on top of your page... For Rent, Houses, etc. then plain old html is usually ok for this.
If you'd like to code the menu in php you could try something like this...

<?php
print <<< MENU
<ul>
<li><a href="/">Home</a></li>
<li><a href="houses.php">Houses</a></li>
<li><a href="forrent.php">For Rent</a></li>
<li><a href="business.php">Business Properties</a></li>
</ul>
MENU;
?>
 
Status
Not open for further replies.
Top