Размер файла: 1.24Kb
<?
require("functionChat.ssp");
function del_utf($s)
{
$i = 0;
while ($i < strlen($s))
{
$chord1 = ord($s[$i]);
if (($chord1 > 127) && (($i+1) < strlen($s)))
{
$i++;
$chord2 = ord($s[$i]);
if (($chord1 < 208) || ($chord1 > 209) || (($chord1 == 208) && ($chord2!=129 && $chord2<144 && $chord2>191)) || (($chord1 == 209) && ($chord2!=145 && $chord2<128 && $chord2>143)))
{
$s[$i-1] = "^";
$s[$i] = "?";
}
}
$i++;
}
return str_replace("^?","?",$s);
}
$r = GetRandom();
openDB();
$result = checkpass($login,$pass,"*");
if ($sel == "") LogResult($ErrorMess,$InvSelNumber,"prev");
$friends = mysql_result($result,0, "friends");
$records = explode(",",$friends);
//echo "sel=$sel<br/>";
// $records = explode("|,",$friends);
if ($sel > count($records)) LogResult($ErrorMess,$InvSelNumber,"prev");
array_splice($records, $sel-1, 1);
$friends = implode(",",$records); // ##########################
$sqlUpd = "update users set friends='$friends' where nick='$login' and pass = '$pass'";
mysql_query($sqlUpd) or die(mysql_error());
LogResult($OKMess,$menu[55],"notes.php?p=$r&login=$login&pass=$pass");
?>