have a checkbox, and if it hasn't been checked, the index won't be posted with the POST contents.
then you need to check by
isset()
$checkboxvalue=isset($_POST["checkbox"])?'yes':'no';
So you have to call:
checkbox_value('bikeBag')
instead, and not the posted value!
And you should not post user primary keys with a form which is come from a session variable, use the session variable instead.
exit should used after you redirect the user by header()
header("Location: main.php");
exit();
Try this code:
header("Location: main.php");
file_put_contents("text.txt" , "VALUES");
And you will seethe new file and its content...