insanityseanboy Posted January 27, 2010 Share Posted January 27, 2010 I'm sure I'm making some stupid little mistake here... This is in the form in cc.php... <form action="sc.php" method="post"> ... <input type="checkbox" value="true" name="Acute Sight" /> ... <input type="submit" value="Submit" /> </form> This is in sc.php <?php if (isset($_POST["Acute Sight"])) echo "<B> Acute Sight </B><BR />"; ?> So the plan is to have a checkbox that will print a line in sc.php but at the moment it's printing nothing. Can anyone point me in the right direction? Link to comment https://forums.phpfreaks.com/topic/190000-basic-checkbox-question/ Share on other sites More sharing options...
teamatomic Posted January 27, 2010 Share Posted January 27, 2010 $acute_sight=$_POST['acute_sight']; if (isset($_POST["acute_sight"])) echo "<B> $acute_sight </B><BR />"; Note the underscore, use it instead of a space. Change your input widget to match. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/190000-basic-checkbox-question/#findComment-1002422 Share on other sites More sharing options...
insanityseanboy Posted January 27, 2010 Author Share Posted January 27, 2010 You sir, are a legend. Interestingly, I didn't need to change the spaces to underscores in cc.php, so they must be converted - is that a property of POST? Link to comment https://forums.phpfreaks.com/topic/190000-basic-checkbox-question/#findComment-1002430 Share on other sites More sharing options...
teamatomic Posted January 27, 2010 Share Posted January 27, 2010 Not that I know of. But then I'm old school and have never used spaces in anything but a sentence. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/190000-basic-checkbox-question/#findComment-1002436 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.