Forum Moderators: coopster

Message Too Old, No Replies

print out some values from when user click a check box

print out some values from when user click a check box

         

xbl01234

11:59 pm on Dec 17, 2006 (gmt 0)

10+ Year Member



Hello;
I want to print out some value when a user click on a check box. But my code does not works, could you tell why, thanks.

<html>
<body>

<form action='deleteR.php' method="POST">
<input type="checkbox" name="bike">
i have a bike. <br>
<input type="checkbox" name="car">
I have a car.
<br>
<input type="submitD" value="submit">
<input type="reset" value="reset">
</form>

</body>
</html>


in the deleteR.php file

<?
if($_POST['bike']!=null)
echo "This is bike ";

echo "<br>";

if($_POST['car']!=null)
echo " This is car.";

?>

eelixduppy

12:46 am on Dec 18, 2006 (gmt 0)



What isn't working? It looks ok. The only problem I see is in your HTML:

<input type="submitD" value="submit">

Change to:


<input type="[b]submit[/b]" value="submit">

dreamcatcher

1:10 am on Dec 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the PHP is failing it may also be that you have the short tags directive disabled in your PHP.ini file, in which case use <?php instead of <?

dc

xbl01234

2:15 am on Dec 18, 2006 (gmt 0)

10+ Year Member



Thanks, you are right, I need to change the submitD to submit.