Recognize and put all links below in a drop down

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xnukerx
Forum Newbie
Posts: 2
Joined: Thu Jul 08, 2010 2:35 am

Recognize and put all links below in a drop down

Post by xnukerx »

Hi,

I have a forum when members posting a lot of images links. I would like to organize the page but I don't really know how since I'm lack the knowledge of php :| .

Here it how it's look like now:

IS:
http://img78.imageshack.us/img78/3997/123.jpg
http://img78.imageshack.us/img78/3997/12345.jpg

TP:
http://i42.tinypic.com/123.png
http://i42.tinypic.com/123.png

and so on with a lot of images hosting and links.

I would like to recognize "IS:" "TP:" and receive every links below them and put them in drop down menu, so it's look like that:
[IS] [TP]
or vertical
[IS]

[TP]

and when you click on one of them, it's look like that:
Clicked on IS:
[IS] [TP]
http://img78.imageshack.us/img78/3997/123.jpg
http://img78.imageshack.us/img78/3997/12345.jpg

or vertical. Clicked on TP
[IS]

[TP]
http://i42.tinypic.com/123.png
http://i42.tinypic.com/123.png

I would be very very thankful for your help
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Recognize and put all links below in a drop down

Post by Jade »

None of your picture links work... not sure how we can help you if we can't figure out what you're trying to do.

However the basic concept is to search through the page looking for http:// and www. and pull the data until you get to the next space or symbol (\n \t)or tag or end of the line. Put those into an array and then loop through the array to display those values in a select drop down box.
xnukerx
Forum Newbie
Posts: 2
Joined: Thu Jul 08, 2010 2:35 am

Re: Recognize and put all links below in a drop down

Post by xnukerx »

Jade wrote:None of your picture links work... not sure how we can help you if we can't figure out what you're trying to do.

However the basic concept is to search through the page looking for http:// and www. and pull the data until you get to the next space or symbol (\n \t)or tag or end of the line. Put those into an array and then loop through the array to display those values in a select drop down box.
Hi jade,

This is exactly the concepte I'm thinking of, but I don't have the tools to implement it.
I will be happy to get explanation how do implement it.

The links are only for example.

Thanks for reply.
Post Reply