I fetch a value from my database table named 'spouse' which has a value of "Elizabeth Jik", and stored it in a session variable named $_SESSION['spouse'].
Now I try to output the value in a input type text field. Here is my code:
<?php
session_start();
$spouse = $_SESSION['spouse'];
if($_SESSION['cstatus'] == 'Married')
{
$display_spouse = "<input type=\"text\" name=\"spouse\" maxlength=\"80\" value=".$spouse." >";
}
?>
<html>
.
.
.
<div>
<?php echo $display_spouse; ?>
</div>
.
.
.
</html>
The code works and it does output a value, however, it only prints Elizabeth. The surname Jik is missing. Why is that?