Re: Call functions from a link with ?op=function_name
| From: | Lars Torben Wilson | Date: | Tue, 07 Nov 2000 02:31:07 +0000 |
| Subject: | Re: Call functions from a link with ?op=function_name | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24042@lists.php.net to get a copy of this message | ||
Jimmy Gendron writes:
>
> Hello;
>
> I've got one big file with several functions in it;
>
> I would like to know if i can call functions by using the http link like
> this:
>
> link.php?op=function_name
>
> is it possible??
>
> Thank you for your help!
>
> Jimmy
link.php:
<?php
function somefunc() {
echo "Somefunc<br>\n";
}
if (isset($op) && function_exists($op)) {
$op();
}
?>
For more information:
http://www.php.net/manual/functions.variable-functions.php
Hope this helps,
Torben
--
+----------------------------------------------------------------+
|Torben Wilson <torben@php.net> Netmill iTech|
|http://www.coastnet.com/~torben http://www.netmill.fi|
|Ph: 1 250 383-9735 torben@netmill.fi|
+----------------------------------------------------------------+