LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2005, 05:16 AM   #1
xemous
Member
 
Registered: Jun 2004
Posts: 80

Rep: Reputation: 15
$HTTP_POST_VARS doesn't accept disabled input fields


Code:
<input type='text' name='total' size='5' value='22' disabled>
If I use a

$Total = $HTTP_POST_VARS['total'];

in my php script, I get a:

Notice: Undefined index: total in C:\Server\Apache2\htdocs\bloodaxe\checkout.php on line 3

But if I remove the disabled from the input field, it works ok, but then the field is enable to be tampered with again !

How can I get it to accept the variable while still keeping the field disabled?

Cheers !
 
Old 08-16-2005, 05:23 AM   #2
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
http://www.faqs.org/docs/htmltut/for..._DISABLED.html

In the above article it seems what you are trying to is not possible and it is not a limitimation of PHP, rather HTML. Instead of disabling the input you need to make it readonly.

I have not tested this, its just my interpretation of the above article, let us know if it works or not.
 
Old 08-16-2005, 05:34 AM   #3
xemous
Member
 
Registered: Jun 2004
Posts: 80

Original Poster
Rep: Reputation: 15
It worked, cheers mate.
 
Old 08-16-2005, 05:49 AM   #4
phil.d.g
Senior Member
 
Registered: Oct 2004
Posts: 1,272

Rep: Reputation: 154Reputation: 154
excellent,

On a side note you could use CSS to make the textbox appear disabled: grey background, etc if you wish.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
accept input escape new line monil Programming 12 03-18-2005 12:10 PM
Lilo (and Grub) don't accept keyboard input gdbugger Mandriva 0 09-07-2004 02:21 AM
Can't get any output from my mic. Won't accept input. Please help Fear58 Linux - Hardware 1 07-06-2004 11:42 PM
RH 8.0 installer wont accept keyboard input exitsfunnel Linux - General 1 05-27-2003 10:18 AM
RH 8.0 installer won't accept keyboard input exitsfunnel Linux - Software 2 05-27-2003 06:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration