Assume my web page to be something like this:
// Assume that the 'firstname' value from the session is the name O'Malley
$firstname = $_SESSION['firstname'];
<input id="txtFirstName" value="<?php echo $firstname; ?>" />
The above will work just fine by displaying O'Malley in the text field.
But if the first name value from the session were O"Malley (NOTE, it's a double-quote this time), it will just display "O". I understand why this is happening because the HTML now will look like this after it is rendered:
<input id="txtFirstName" value="O"Malley" />
I need to be able to display quotation marks in fields if the user chooses to input such. Maybe the user wants to enter O'Malley "The Man" as the first name value, it will mess up when displayed.
Can anyone show me how to make this work please?