ONLCLICK to a DROP DOWN LIST .... how with PHP?

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
wahabr
Forum Newbie
Posts: 2
Joined: Mon Aug 04, 2008 7:04 am
Location: Amman - Jordan

ONLCLICK to a DROP DOWN LIST .... how with PHP?

Post by wahabr »

hi guys ,
it would be more than nice if u can help me deal with this , i am new to PHP and i am trying to get data from MYSQL if a link is clicked , and after that the data query should end up in a drop down list under the link clicked ...... HELP :(
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: ONLCLICK to a DROP DOWN LIST .... how with PHP?

Post by jaoudestudios »

If you want to do that without reloading the page then you need to use AJAX.

But it is not easy.

I would just reload the page.

On the link have a flag, when this link is clicked it sets a GET variable. Have the list in an IF statement and if $_GET['flag'] is set to what you want, get info from database and display list to page.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: ONLCLICK to a DROP DOWN LIST .... how with PHP?

Post by RobertGonzalez »

With the right JS library it is a snap (think jQuery) if what you are asking is what I am thinking. What are you trying to do?
wahabr
Forum Newbie
Posts: 2
Joined: Mon Aug 04, 2008 7:04 am
Location: Amman - Jordan

Re: ONLCLICK to a DROP DOWN LIST .... how with PHP?

Post by wahabr »

i need to get a number of links , if one is clicked it should get from the database from a certain table some info to display in the same list , after that , clicking on another link (lets say download chosen option), it should go to download.php for example
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: ONLCLICK to a DROP DOWN LIST .... how with PHP?

Post by RobertGonzalez »

Have you written any code at all? Sounds like you know what you want but you want us to offer the code to do it. That isn't going to happen here.

Let me suggest you try something first. When what you are trying doesn't work, post what you have tried and let us try to help you.
Post Reply