Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.