> There MUST be some creative way to call a user-defined PHP function
> an <a href> tag. Does anyone have any suggestions?

Yeah, I got one. It's kind of crazy, but how about we assume PHP is
server side and anything that happens in the browser is called, well,
let's say client side. Let's, for argument's sake, say that server side
happens first to create the client side code. After the server side part
is done, it's done. It can't affect anything client side unless you
request another page or refresh the page.

> <a href="<?php joe(); ?>"> Click here to start "function joe()". </a>

<a href="function.php">click here to run function joe().</a>

Then place the following in function.php file:

> <?php
> function joe() {
>   $temp1=10;
>   $temp2=20;
>   $result=$temp1+$temp2;
>   echo "The result of this function is: " . $result;
> }
> ?>

> So, if the user clicks on the link, he'll see:  "The result of this
> function is: 20"

And he will, but it requires a page to be requested...otherwise use

---John Holmes...

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

Reply via email to