faqts : Computers : Programming : Languages : PHP : General Information

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 57 people (39%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How to run a PHP function when a link is clicked?

Sep 30th, 2002 15:57
Alex Dean, Ted Lee,


You can point your link to a PHP script which will run the function you
want.
example.html
<html>
<body>
  <a href="example.php">click here</a>
</body>
</html>
example.php
<?
  //your function here.
?>
Remember that PHP only runs on the web server, not in the client
browser.  You can't call a PHP function in the same way you can call a
JavaScript function, because while JavaScript runs in the browser, PHP
only exists on the web server.
--alex