Hello,
I use PHP 4.3.10 and want to deliver a post variable from a PHP page to
itself.
In my page mypage.php I have a hidden field named "dbaction" and a form
button. When clicking the form button a javascript function is called where
the dbaction hidden field is set to the value "change" (=actn) and then the
form gets submitted.
function doAction(actn) {
document.forms[0].dbaction.value = actn;
document.forms[0].submit();
}
actn is delivered properly here!
At the recall of mypage.php (after submit) I expect the hidden field
dbaction as POST variable know. I have the statement
if (isset($HTTP_PO ST_VARS['dbaction']))
to ask whether dbaction exists or not. At the first call of mypage.php it
doesn't exist because there was no post request but after the form submit
dbaction should exist as post variable (I have defined method=post in my
<form> tag).
What now happens is that after the post request dbaction is set but always
is an empty string instead of having the value "change".
What's going on here? Why does the post parameter not get delivered as it is
set before? Why do I get an empty string as delivered value?
By the way I have the php property "register_globa ls" set off which is
highly recommended due to security reasons and I want to let it turned off.
Any help to this would be much appreciated.
Thanks in advance.
Nice greetings from
Thomas
I use PHP 4.3.10 and want to deliver a post variable from a PHP page to
itself.
In my page mypage.php I have a hidden field named "dbaction" and a form
button. When clicking the form button a javascript function is called where
the dbaction hidden field is set to the value "change" (=actn) and then the
form gets submitted.
function doAction(actn) {
document.forms[0].dbaction.value = actn;
document.forms[0].submit();
}
actn is delivered properly here!
At the recall of mypage.php (after submit) I expect the hidden field
dbaction as POST variable know. I have the statement
if (isset($HTTP_PO ST_VARS['dbaction']))
to ask whether dbaction exists or not. At the first call of mypage.php it
doesn't exist because there was no post request but after the form submit
dbaction should exist as post variable (I have defined method=post in my
<form> tag).
What now happens is that after the post request dbaction is set but always
is an empty string instead of having the value "change".
What's going on here? Why does the post parameter not get delivered as it is
set before? Why do I get an empty string as delivered value?
By the way I have the php property "register_globa ls" set off which is
highly recommended due to security reasons and I want to let it turned off.
Any help to this would be much appreciated.
Thanks in advance.
Nice greetings from
Thomas
Comment