andreasb Posted March 3, 2010 Share Posted March 3, 2010 Hello, I'm currently making a script where I want to disable one of the input text forms. When I disable it the data isn't added to the MySQL database. The same thing happens when I make it hidden. But once I make it editable (normal form) then it's added! Why is that? I have a hidden form which records the IP of the user who signs up, and the IP is added to the database. The value field gets info from a $_GET which fetches some URL bar info (?ref=someusername). BTW: I do see the username in the disabled field when I use a referral link, it's just not added to the DB. Quote Link to comment https://forums.phpfreaks.com/topic/194056-disabled-field-no-mysql-data/ Share on other sites More sharing options...
ialsoagree Posted March 3, 2010 Share Posted March 3, 2010 I think I understood your question from the last line, correct me if I'm wrong... The issue is, a disabled HTML field is not submitted with the user's POST request. If a field is set to disabled, the user's browser doesn't submit the information in that field to the server when the form is submitted. You can use a hidden input field, or you can send the data in the URL the same way you would for a GET request (as a POST request also sends GET data). Quote Link to comment https://forums.phpfreaks.com/topic/194056-disabled-field-no-mysql-data/#findComment-1021132 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.