Re: Re: Calling functions from Button actions

From: Date: Sun, 14 Sep 2003 14:56:42 +0000
Subject: Re: Re: Calling functions from Button actions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-162556@lists.php.net to get a copy of this message
I hope you don't use this method. It is VERY unsafe. You execute ANY function that the user tells you. Daniel Souza wrote:
<? function func1() { } function func2() { } function func3() { } function func4() { } function func5() { } if (isset($_REQUEST['funcs']))
      foreach ($_REQUEST['funcs'] as $key=>$val)
         if (function_exists($key))
            $key();
?> <hr> <form method=POST> <input type=submit name=funcs[func1] value="Execute Function 1"><br> <input type=submit name=funcs[func2] value="Execute Function 2"><br> <input type=submit name=funcs[func3] value="Execute Function 3"><br> <input type=submit name=funcs[func4] value="Execute Function 4"><br> <input type=submit name=funcs[func5] value="Execute Function 5"><br> </form>


« previous php.general (#162556) next »