Page 1 of 1
form field info not transfering to my check page?
Posted: Thu May 11, 2006 2:04 pm
by romanbills
the subject sums it all up. On a registration form on my website you fill in the information upon clicking the submit button it posts to the check page...however it will not transfer the information to the check page? Iv never seen this befor and ready to pull my hair out...any suggestions??
Posted: Thu May 11, 2006 4:31 pm
by jcherry
Are you sure that you have method="post" declared in your form tag?
Could you post some code samples with this? More information would help to answer this since it could be a lot of things.
Posted: Thu May 11, 2006 4:34 pm
by romanbills
thats the first thing i checked...if you dont mind helping me contact me on aol at norcal0816
Posted: Thu May 11, 2006 7:31 pm
by RobertGonzalez
Why not post your code for the community to see? It makes it better for all of us if we can work on the problem together and arrive at a solution together.
On a side note, have you cleared your cache and deleted your cookies? Have you also checked for the presence of the POST array, or a single value of the post array? Lastly, have you tried switching from $HTTP_POST_VARS to $_POST or vice versa depending on your PHP version?
Posted: Thu May 11, 2006 7:56 pm
by jcherry
Everah, you make a good point. I think that he needed to keep his code semi-private, as it seemed as though he is doing this for a client. I will post the solution I gave to him over instant messenger. It was a pretty easy solution.
In order to use local variables (ie $var) that are posted from a form, you either need to assign the variable yourself or turn register_globals on (NOT RECOMMENDED).
Here is a sample:
Code: Select all
$var = $_POST["form_variable"];
//or
$var = $HTTP_POST_VARS["form_variable"];
If you do not do this, you will not be able to access variables that are posted from your form.
Regarding register_globals, turning this on in php.ini will automatically convert your post/get variables into local variables for you. Sounds nice and easy, however there are large security risks intriduced into your script so it it strongly not recommended. In addition, PHP6 will be removing this option entirely from PHP, so you will have to change any scripts that are depended on register_globals anyways.