Old 04-25-2005   #1 (permalink)
Registered User
 
ViciOuS's Avatar
 
Join Date: Apr 2005
Posts: 82

Newbie Question !

Please excuse me for this newbie quesiton. I can't seem to find the answer to this anywhere on my own, so, here goes..

When getting the value of checkboxes, like get whether its checked or not, what do you use?

I've tryed using $_POST['checkboxname'] but it doesnt work. Anyone know a solution?
ViciOuS is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 04-26-2005   #2 (permalink)
code anyone?
 
scrowler's Avatar
 
Join Date: Feb 2004
Location: New Zealand
Posts: 590

Send a message via MSN to scrowler Send a message via Skype™ to scrowler
if register globals is on (it is by default) then you can use $_POST['checkboxname'] and the value will correspond to whichever you select. if it didn't work you could be misspelling one of the variables somewhere.
__________________
BioRUST Tutorials - the birthplace
scrowler is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 04-26-2005   #3 (permalink)
Registered User
 
ViciOuS's Avatar
 
Join Date: Apr 2005
Posts: 82

Well, when I check it, I use TRUE and FALSE. Should this be something else?

i.e. -
if($chkIPpriv == "TRUE") { #... } else{ #... }
ViciOuS is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 04-26-2005   #4 (permalink)
Local Biorust Beast
 
Order's Avatar
 
Join Date: Oct 2003
Location: San Diego, CA, USA
Posts: 2,253

Send a message via AIM to Order Send a message via MSN to Order Send a message via Yahoo to Order
@scrowler: $_POST, $_GET.. are all global variables, they exist even when register_globals are on or off, if register_globals are on, then you have standard variables like $checkboxname, not recommended at all due to security.

@ViciOuS:

Alrighty, well first there is a difference between TRUE and "TRUE", one is a string, one is a boolean. A boolean is a bit variable that is either on or off, or true or false. Using == "TRUE" is like saying if something is equal to TRUE literally, not whether it is true or not.

In forms, place a value on the input, so in your checkbox html tag you should have a value="something", when PHP gets the result, $_POST['checkboxname'] will equal something. This is usually how I do it, but I have not had to deal with checkbox's too very much.
__________________
Order is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 04-27-2005   #5 (permalink)
Registered User
 
ViciOuS's Avatar
 
Join Date: Apr 2005
Posts: 82

Sorry for not mentioning this earlier but i found that mistake like 30 mins after that last post. I was pretty tired that night and I pasted out right after I found the solution.

Thanks once again.
ViciOuS is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Mangament System Question LimitLess HTML / PHP / ASP / JS 3 06-01-2006 12:32 AM
Newbie Question c_rogue69 Adobe Photoshop 3 09-18-2004 08:47 AM
PHP Syntax question BlodoPKNZ HTML / PHP / ASP / JS 9 08-08-2004 09:58 PM
Question... Kitty Adobe Photoshop 4 08-03-2004 07:31 PM
oh another Newbie (and this one is from England) supafly Introductions 66 06-06-2004 02:25 AM


All times are GMT +1. The time now is 04:29 PM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT