Jump to content

Disabled Field -> No MySQL data!


andreasb

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/194056-disabled-field-no-mysql-data/
Share on other sites

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).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.