Hey everyone I was getting the following error on my web page:
Fatal error: Call to undefined function import_request_variables() in /demo/conn.php on line 5
I wrote this replacement. It works for me. I hope it helps you. for example this URL : test.php?z=1
import_request_variables("gp",'abc_');
echo $abc_z; // 1
function import_request_variables($g,$prfix)
{
foreach($_GET as $k => $v)
{
$v_name = $prfix.$k;
global $$v_name;
${$prfix.$k} = $v;
}
foreach($_POST as $k => $v)
{
$v_name = $prfix.$k;
global $$v_name;
${$prfix.$k} = $v;
}
}
I had this problem from before, the work around that i did to fix it i replaced code before with code after that I've written below, so don't use import_request_variables it is deprecated in PHP 5.3 and in PHP 5.4 is removed as it is described in here http://uk3.php.net/import_request_variables, the following is the fix for the problem that i had:
Code Before:
import_request_variables('p');
Code After (Replaced the code above with the code below):
extract($_GET, EXTR_PREFIX_ALL, 'p');
extract($_POST, EXTR_PREFIX_ALL, 'p');