Forum Moderators: coopster

Message Too Old, No Replies

Calling a PHP Function from a href.

PHP and html

         

silk

3:02 am on Oct 26, 2004 (gmt 0)

10+ Year Member



Is it possible to call a php function from a hyperlink?

e.g. <a href="<?php some_php_function()?>">blah</a>

Is this legitimate?

And, how does php handle events. Let's say within a PHP script, there's a link. When someone clicks on the link, i want to query a database. How do i get this sort of functionality from php?

Thanks .

jatar_k

3:48 am on Oct 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> how does php handle events.

it doesn't in the js sense of the word, since php is server side you must send a request to the server for php to be able to work.

>> Let's say within a PHP script, there's a link. When someone clicks on the link, i want to query a database. How do i get this sort of functionality from php?

then you call a new page/script, or the same one with different parameters, and then that script will query your db and return the results to the user.