Page 1 of 1

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

Posted: Mon Aug 04, 2008 7:18 am
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 :(

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

Posted: Mon Aug 04, 2008 9:02 am
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.

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

Posted: Mon Aug 04, 2008 1:34 pm
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?

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

Posted: Tue Aug 05, 2008 3:41 am
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

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

Posted: Tue Aug 05, 2008 9:34 am
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.