PHPjabbers - tools for webmasters
shopping cart (0 item)
HOME
PRODUCTS
PHP TUTORIALS
PHP FORUM
ABOUT US
CONTACT US
Our products

php validation

Posted by David on Jan 29th, 2008

How to validate checkbox and radio button using php

Back
REPLIES
Posted by rayeesh on Jan 9th, 2012

how to validate check box in php
Posted by on Mar 1st, 2011

Posted by chiry on Jan 29th, 2011

Hi, guys
you can find some php validation scripts at the site PHPKode.
There list some php validation script about Validation algorithms.Anti-spam, CAPTCHA, form validation provided.
Hopefully can help you!
Best regards!
chiry
Posted by hari krishna on Aug 10th, 2010

Thanks for ur valuable information...
ur explanation is short and sweet!!
Posted by shalu on Feb 18th, 2009

thank you soo muchhh... itz workin for meeeee....it eas a gr8 help
thanx
Posted by Jim on Aug 24th, 2008

I also found it very helpful. Cheers.
Posted by David on Feb 6th, 2008

Thank you very much for these important information very nice from you!!!
Am actually working on a project for a computerized system using Web technology!! I will try it Thanks a lot!!!
Posted by Alin Cojocaru on Feb 4th, 2008

For a "POST" form, you can validate the checkbox like this:
if(isset($_POST['checkbox_name'])) {
echo 'The checkbox was selected'; //Here you do whatever you want to do next.
} else {
echo 'The checkbox wasn't selected';
}

Regarding the radio button, if you have an option like "yes" or "no", here is an example:
<input type="radio" name="option" value="yes"> <input type="radio" name="option" value="no">
//processing page
if($_POST['option'] == 'yes') {
echo '"Yes" option was selected.';
} elseif($_POST['option'] == 'no') {
echo '"No" option was selected.';
} else {
echo 'None of the options were selected.';
}
Good Luck
 
POST A REPLY
Your name:
Your email: (email address will not be posted on the website)
Reply:
Verification code:
type characters on the image in the text box