Jump to content

Echoing Special Characters


nightkarnation

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.