Hi, here's the scenario. I have a comments page that consist of a three element form. The first two elements are Name and Password respectively. The third is a Comments (textarea) box. in order for the submission to succeed, the user name and password must be correct (looked up in mysql database). If its correct, its submitted.. if it's not correct then the results page says "invalid username and password" So that the person submitting doesn't have to retype his/her hard work I echo the comments ($comment) in the text area field. This works fine until someone uses ' (apostrophe) and other special characters. when those are encountered, a Japanese YEN symbol is placed before it in the echoed text. My question is, how do I get this text to echo correctly in the comments box? the code isn't complicated but its kinda windy. I'll post it here for those who are interested.
thx
blue
if($user and $pass and $comment)
{
$connection = mysql_connect("bpresley","root","");
$db = mysql_select_db("chrdb",$connection);
$sql1 = "select username, password from users where username = '$user' and password = '$pass'";
$query1 = mysql_query($sql1);
$numrows = mysql_num_rows($query1);
if($numrows == "0") {
$loggedin = "2";
} else {
$loggedin = "1";
$sql2 = "insert into $tabletype values (NULL,'$id','$user','$comment',curdate())";
$query2 = mysql_query($sql2);
setcookie("username",$user);
setcookie("password",$pass);
}
} else {
$loggedin = "0";
}
if($loggedin == "2")
{
echo ("
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\" color=\"#FF000\">Invalid Username or Password.</font><br>
<form name=\"form1\" method=\"post\" action=\"$PHP_SELF\">
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Username:</font><br>
<input type=\"text\" name=user value=\"$user\">
<br>
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Password:</font><br>
<input type=\"password\" name=\"pass\" value=\"$pass\">
<br>
<font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Review
or comments about <b>$name</b>:</font><br>
<textarea name=\"comment\" cols=\"60\" rows=\"5\">$comment)</textarea>
<br>
<input type=\"hidden\" name=\"tabletype\" value=\"$tabletype\">
<input type=\"hidden\" name=\"id\" value=\"$id\">
<input type=\"submit\" name=\"Submit\" value=\"Submit\">
</form>");
)
note the page calls itself for posting.