Schunkeffect Posted March 28, 2006 Share Posted March 28, 2006 Well I know there has been a lot of talk on this forum about passing variables via the URL, and session variables, etc ... I have searched for my answer but was unable to find it. It's pretty basic, but I just can't figure it out.What I have is a form with some fields that are disabled. Essentially, a user would click on a URL (with embedded variables) and a form would them show up that was paritally filled out (with the embedded variables in the disabled fields). If I submit this form to a .php page that runs a query, the disabled fields are NOT passed to the .php page that runs the Query. However, if I leave these fields as input type (AKA not disabled) the variables are passed to the next page. I am calling these variables using $_GET["variable"] on the page that runs the Query. Do any of you know why I can't pass the variables if the field is disabled??Thanks in advance,Nate Quote Link to comment https://forums.phpfreaks.com/topic/6015-disabled-wont-pass-variable/ Share on other sites More sharing options...
kenrbnsn Posted March 28, 2006 Share Posted March 28, 2006 If a field is disbled it won't pass the value back -- that's part of HTML. If you want to leave a the field disabled and still be able to pass the value, you should use a hidden field.You really should change the method to POST, it makes your data a little more secure. When you use GET, a malicous user could see what you're passing back and design a URL that looks like it came from your form, but really didn't. Of course, they can still do that with the POST method, but they have to read the source to find what you're sending.Ken Quote Link to comment https://forums.phpfreaks.com/topic/6015-disabled-wont-pass-variable/#findComment-21609 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.