form field info not transfering to my check page?
Moderator: General Moderators
-
romanbills
- Forum Newbie
- Posts: 8
- Joined: Thu May 11, 2006 2:00 pm
form field info not transfering to my check page?
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??
-
romanbills
- Forum Newbie
- Posts: 8
- Joined: Thu May 11, 2006 2:00 pm
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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?
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?
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:
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.
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"];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.