Code: Select all
echo "<b>Quantity:</b> <input type=\"text\" name=\"qtyBox\" value=\"1\" size=\"1\" />";Code: Select all
$_SESSION['qtyBox'] = $_POST['qtyBox'];
$qtyBox = $_SESSION['qtyBox'];
echo $qtyBox;Moderator: General Moderators
Code: Select all
echo "<b>Quantity:</b> <input type=\"text\" name=\"qtyBox\" value=\"1\" size=\"1\" />";Code: Select all
$_SESSION['qtyBox'] = $_POST['qtyBox'];
$qtyBox = $_SESSION['qtyBox'];
echo $qtyBox;Code: Select all
echo "<b>Quantity:</b> <input type='text' name='qtyBox' value='1' size='1' />";
Why? Escaping the double quotes as he is doing will work fine and is acceptable when encapsulated within double quotes. I believe the HTML spec says to encapsulate element attributes in double quotes as oposed to single quotes.JakeJ wrote:When your echo is surrounded by double quotes, replace all of the double quotes except the first and the last with single quotes as follows.
Code: Select all
echo "<b>Quantity:</b> <input type='text' name='qtyBox' value='1' size='1' />";
Code: Select all
echo $_POST['qtyBox'];