Reputation: 990
I am using a php variable in html. $userProfile['institute']
is displaying correct value whenever $userProfile['institute']
is non-empty. When $userProfile['institute']
is empty , it display '/'. What may be the issue here ?
Institute: <input type="text" name="institute" value=<?php echo $userProfile['institute']?> /><br />
Upvotes: 0
Views: 76
Reputation: 2240
You should add double quotes around it like this (like you have wrapped value of type and institute attributes )
Institute: <input type="text" name="institute" value=" <?php echo $userProfile['institute']?>" /><br />
Upvotes: 0
Reputation: 869
You are missing a set of quotes for your value attribute
value="<?php echo $userProfile['institute']?>"
Upvotes: 3