When I wanted to test whether the value is properly passed from HTML form to PHP, I found something is wrong with the echo statement. Here is the HTML text box code
<div class = form-group> <label for = 'bcaa'>BCAA 5gms Cost</label> <input type = 'text' class = 'form-control' name = 'bcaa'> </div> And here is the PHP code to get the value and print it simply.
<?php $bcaacost = isset($_POST['bcaa']) ; echo $bcaacost; ?> The value given in the text box is not printed, but simply '1' is printed the more echo statement is added more no of '1' is printed
Like
echo "something"; echo "blah blah"; The output is
11 What's the reason for this and what do I need to do to fix this?
issetis a boolean TRUE or FALSE. That should be all you need to know$bcaacost = isset($_POST['bcaa']) ? $_POST['bcaa'] : "";