Re: Passing variables to a PHP script on clicking a hyperlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/23/07, Suamya Srivastava <suamya.srivastava@xxxxxxxxxxxxx> wrote:
> Hello,
>
> How can I pass variables on clicking a hyperlink to a PHP script? I have 5
> hyperlinks, all pointing to the same PHP script. However, on clicking each
> hyperlink a different value of the variable needs to be passed to the PHP
> script.
> i.e.  I have 5 databases from which I want to obtain information, however
> the information should be displayed only when the user clicks on the
> hyperlink for that database. How can I pass the database name to the PHP
> script? How would the script know which database to get information from?
>
> I am new to PHP so any help would be greatly appreciated. I hope my
> question is clear.

use GET

foo.php?param=value

or you could use POST by using some client-side javascript to do a
form submit with key/value pairs.

this is a *very* simple operation... all web-enabled languages
understand HTTP POST/GET/etc. - those are the main ways of exchanging
data between client/server.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux