Problem is whenvever I enter Sally's New Car into a form and post to a new page the apostrophie is lost so I get:
Sally s
when I echo it on the page it's posted to. I think I need the PHP function: htmlspecialchars. I've seen the man page but still not sure how to implement - if anyone could provide a snippet I would be grateful. Here's my existing form below...how would I use htmlspecialchars?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"<html xmlns=" lang="en" xml:lang="en">
<html>
<head>
<title>MYSQL/PHP How-to Insert Form</title>
<link rel="stylesheet"
href=" type="text/css">
</head>
<body>
<h1>How-to Insert Form</h1>
<?php
echo
'<form method="post" action="populate4.php">
<H3>Url Field</H3>
<input type="text" name="url_field" size=80 maxlength=199>
<H3>Title Field</H3>
<input type="text" name="title_field" size=80 maxlength=199>
<H3>Description Field</H3>
<textarea name="descrip_field" rows=15 cols=56
maxlength=1000></textarea>
<H3>Submit keywords with a file <i>or</i> with the text area
below</H3>
<input TYPE="radio" NAME="Type_Submit" VALUE="radio_file">
Use Key Word File
<br>
<input TYPE="radio" NAME="Type_Submit" VALUE="radio_area"
Checked > Use Key Word Text Area
<H3>Keyword file</H3>
<input type="text" name="kw_file" size=40
maxlength=80><h4><i> or </i></h4>
<H3>Keyword text area</H3>
<textarea name="kw_tarea" rows=10 cols=40></textarea>
<H3>Insert into MYSQL</H3>
<input type="submit" value="Insert">
</form>';
?>
</body>
</html>
Sally s
when I echo it on the page it's posted to. I think I need the PHP function: htmlspecialchars. I've seen the man page but still not sure how to implement - if anyone could provide a snippet I would be grateful. Here's my existing form below...how would I use htmlspecialchars?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"<html xmlns=" lang="en" xml:lang="en">
<html>
<head>
<title>MYSQL/PHP How-to Insert Form</title>
<link rel="stylesheet"
href=" type="text/css">
</head>
<body>
<h1>How-to Insert Form</h1>
<?php
echo
'<form method="post" action="populate4.php">
<H3>Url Field</H3>
<input type="text" name="url_field" size=80 maxlength=199>
<H3>Title Field</H3>
<input type="text" name="title_field" size=80 maxlength=199>
<H3>Description Field</H3>
<textarea name="descrip_field" rows=15 cols=56
maxlength=1000></textarea>
<H3>Submit keywords with a file <i>or</i> with the text area
below</H3>
<input TYPE="radio" NAME="Type_Submit" VALUE="radio_file">
Use Key Word File
<br>
<input TYPE="radio" NAME="Type_Submit" VALUE="radio_area"
Checked > Use Key Word Text Area
<H3>Keyword file</H3>
<input type="text" name="kw_file" size=40
maxlength=80><h4><i> or </i></h4>
<H3>Keyword text area</H3>
<textarea name="kw_tarea" rows=10 cols=40></textarea>
<H3>Insert into MYSQL</H3>
<input type="submit" value="Insert">
</form>';
?>
</body>
</html>