Re: Calling function in php page via GET?

From: Date: Tue, 18 Mar 2003 17:00:30 +0000
Subject: Re: Calling function in php page via GET?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140142@lists.php.net to get a copy of this message
Not built in, that would be a HORRIBLE security risk. You can try something like this (untested): call_user_func_array($_GET['func'],$_GET['params']); Then use it like myscript.php?func=somefunction&params[]=foo&params[]=bar, which would be the same as calling somefunction('foo','bar'); Daniel Joyce wrote:
I have a file that draws charts, called chart.php. Right now, I can call it using GET methods inside <IMG> tags.... <IMG src="chart.php?foo=bar"> Well, I'd like to be able to wrap it in a function, and call it via a function.... drawgraph(); and by GET syntax.... <IMG src="chart.php.drawgraph?foo==bar"> ?????? Is there a way to call a FUNCTION/METHOD in a php file using URLS? -Daniel
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#140142) next »