php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25214 import_request_variables "empty"
Submitted: 2003-08-22 17:45 UTC Modified: 2003-08-24 22:06 UTC
From: spin9 at terra dot com dot br Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.2 OS: win98/xp
Private report: No CVE-ID: None
 [2003-08-22 17:45 UTC] spin9 at terra dot com dot br
Description:
------------
I'm trying to use the function import_request_variables exactly as the manual example and my variable returns empty.

Reproduce code:
---------------
import_request_variables("P", "frm_");
echo $frm_nameField;

Expected result:
----------------
the value of nameField of the form.
:
<input type="text" name="nomeField" maxlength="50" size="35"> 

the method of the form is post
<form method=post action="some.php?tab=pes"> 

Actual result:
--------------
blank. The echo does not output anything, only when I use:
echo $_POST["nomeField"];

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-22 17:50 UTC] spin9 at terra dot com dot br
nomeField = nameField at the source code, I made a mistake only here not in the source code. Thanks.
 [2003-08-24 21:18 UTC] spin9 at terra dot com dot br
I still unable to get import_request_variables function working properly after install of php stable version. I do one print_r($_POST); and every form name/value is there. I really don't know what is wrong.
my function: function foo()
{
	import_request_variables("P", "frm_");
	echo $frm_nomeField;
}

but a // print_r($_POST); shows nomeField

any suggestion?
thanks.
 [2003-08-24 21:49 UTC] sniper@php.net
You're just doing something wrong. This works just fine:

test.php:
-----------------------8<----------------------
<form action="test.php" method="post">
<input type=text name="plain" value="foo">                                                     
<input type=submit><br>
</form>
<?php

import_request_variables("P", "frm_");

if (isset($frm_plain)) {     
    echo "\$frm_plain is set to '$frm_plain'";
} else {
    echo "\$frm_plain is not set!";
}
  
?>
-----------------------8<----------------------

Please try the above example. It works just fine for me..


 [2003-08-24 21:53 UTC] spin9 at terra dot com dot br
Ok, I tryed the same example and it worked fine to me now. But when I put the function import_request_variables inside another function it doesn't get the values back. Maybe need I use some "$globals" to access it? Thank you.
 [2003-08-24 21:55 UTC] sniper@php.net
Please ask support questions like that elsewhere, this is not some newbie support forum. (this is NOT any bug)

 [2003-08-24 22:06 UTC] spin9 at terra dot com dot br
this was not a newbie question, maybe you can add some note in the help file as the others functions has. Sorry and thank you anyway.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Aug 16 21:00:03 2025 UTC