Hi Guys,
I'm having a little problem and wondered if someone might be able to lend me a little help.
I have a screen that allows users to edit product information. To do this the existing information is being echoed into text fields.
The problem is that if the string contains a single quote, it breaks the string and only part is displayed. The current code is;
$name=htmlspecialchars($name);
$phone=htmlspecialchars($phone);
$address=htmlspecialchars($address);
echo "
<form action='./addcontact_submit.php' method='post'>
<br />
<label for='name'>Contact Name</label> <input type='text' name='name' id='name' maxlength='100' class='form_input' value='$name'/>
<br />
<label for='price'>Contact Phone</label> <input type='text' name='phone' id='phone' maxlength='100' class='form_input' value='$phone' />
<br />
<label for='description'>Contact Address</label><textarea name='address' name='address' rows=6 cols=40>$address</textarea>
<br />
<label> </label><input type='submit' value='Submit' class='button' /></form>";
So if the existing variable for $name is Creme Egg's, then when it is displayed only Creme Egg appears.
Is there a simple way to overcome this, any help would be gratefully received.
Thanks,