MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Whenever I send the form, phpinfo reports the query string as
prueba.php?textoprueba=Prueba&Enviar=enviar
but it processes the query as if textoprueba was empty (see script).
I found the answer somewhere else and here it is, hope it is useful to someone else
That is because GET/POST variables are not set in the global scope by default in PHP in newer installs. It was changed starting on version 4 I think.
You need to access the variable like this
echo $_GET['text'];
or if it came from a POST form ...
echo $_POST['text'];
it is $_POST['name'] //notice the underscore
You can turn register_globals on in php.ini and have the variables registered automatically, but it isn't a good idea.
Registering globals is a potential security risk. There is a reason the php consortium decided to discontinue the convenience. I say get in the habit of using your superglobals:
$_POST & $_GET. Only grab the vars you need.
ex. $var=$_POST['var'];
I recommend adopting this style for all your future scripts. For old scripts, I say if you don't want to bother fixing them, and I don't blame you, throw these lines at the top of each script:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.