由于checkbox特殊性所以我们要获取它的值,在很我语言中都不一样的,在php中我们是以数组形式来处理,并且利用遍历他的值,下面有大量实例.
checkbox demo checkbox demo
demonstrates checkboxes
handleformcheckbox.php
class="brush:php;">checkbox demo demonstrates reading checkboxes
chksoda: $chksoda
chkshake: $chkshake
chkketchup: $chkketchup
here; $total = 0; if (!emptyempty($chkfries)){ print ("you chose fries
"); $total = $total + $chkfries; } if (!emptyempty($chksoda)){ print ("you chose soda
"); $total = $total + $chksoda; } if (!emptyempty($chkshake)){ print ("you chose shake
"); $total = $total + $chkshake; } if (!emptyempty($chkketchup)){ print ("you chose ketchup
"); $total = $total + $chkketchup; } print "the total cost is $$total";
立即学习“PHP免费学习笔记(深入)”;
实例:
class="brush:php;">'); }using default checkbox values "; foreach($food as $foodstuf) { echo "".htmlentities($foodstuf)."
"; } } else { echo ("
本文地址:
转载随意,但请附上文章地址:-)










