nightkarnation Posted November 8, 2010 Share Posted November 8, 2010 Hey Guys, I think this is a question with a simple answer that I dont know... I receive POSTS that have special characters like Accents on letters, (I dont want to Escape them) I need those characters, but my script is modifying them, heres the php script: if ($action == "retrieveUserIdsStatus") { $p_id=mysql_real_escape_string($_POST['PId']); $statusOne=mysql_real_escape_string($_POST['StatusOne']); $statusTwo=mysql_real_escape_string($_POST['StatusTwo']); if ($statusTwo == "Em Análise") { $statusTwo = "Em Análise"; $statusTwo = mysql_real_escape_string($statusTwo); } $result = mysql_query("SELECT DISTINCT user_id FROM users WHERE purchase_id = '$p_id' AND (status = '$statusOne' OR status = '$statusTwo')"); $cant = 0; while($row=mysql_fetch_array($result)) { echo "user_id$cant=$row[user_id]&"; $cant++; } echo "cant=$cant&"; echo "status1=$statusOne&"; echo "status2=$statusTwo&"; if($result) { $imdoneUpdate = true; echo "imdoneUpdate=".$imdoneUpdate; } else { $imdoneUpdate = false; echo "imdoneUpdate=".$imdoneUpdate; } } As you can see, I have to create the IF statement, because I am receiveing the $statusTwo variable as Em Análise when it is actually being sent as: Em Análise Any ideas or suggestions on how I can fix this? Thanks in advance! Cheers, Link to comment https://forums.phpfreaks.com/topic/218146-echoing-special-characters/ Share on other sites More sharing options...
OldWest Posted November 9, 2010 Share Posted November 9, 2010 Replace this line: $statusTwo=mysql_real_escape_string($_POST['StatusTwo']); With this: $statusTwo = $_POST['StatusTwo']; Probably not such a good idea for security reasons and database vulnerability, but it might work as a temp fix.. Give it a shot! Link to comment https://forums.phpfreaks.com/topic/218146-echoing-special-characters/#findComment-1132097 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.