<?php
/*
$perpage = $_GET['pp'];
$total = $_GET['total'];
$currentpage = $_GET['c'];
$p = simple_pagination($perpage, $total, $currentpage);

echo $_POST['limit'];
echo "?>
<?php
/*
$userinfo = UserInfo(false);
return data is string.
$userinfo = UserInfo(true);
return data is array('ip', 'host', 'httpvia', 'date', 'browser', 'requesturi');
*/
function UserInfo($array=false){
            if (
getenv('HTTP_CLIENT_IP')) {
                
$ips[]                 = getenv('HTTP_CLIENT_IP');
            }
            if (
getenv('HTTP_X_FORWARDED_FOR')) {
                
$ips[]                 = getenv('HTTP_X_FORWARDED_FOR');
            }
            if (
getenv('HTTP_X_FORWARDED')) {
                
$ips[]             = getenv('HTTP_X_FORWARDED');
            }
            if (
getenv('HTTP_FORWARDED_FOR')) {
                
$ips[]                 = getenv('HTTP_FORWARDED_FOR');
            }
            if (
getenv(HTTP_?>
<?php
function KuNumbersWriting($number){
        
$kuindex = array(   0=> 'سفر'=> 'یەک''دوو''سێ',  'چوار''پێنج''شەش''حەوت''هەشت''نۆ'
                                    
11 => 'یازدە'12 => 'دوازدە'13 => 'سێزدە'14 => 'چواردە'15 => '‌پازدە'16 => 'شازدە'17 => 'حەڤدە'18 => 'هەژدە'19 => 'نۆزدە'
                                    
10 => 'دە'20 => 'بیست'30 => 'سی'40 => 'چل'50 => 'پەنجا'60 => 'شەست'70 => 'حەفتا'80 => 'هەشتا'90 => 'نەوەد'
                                    
100 => 'سەد'
                                    
1000 => 'هەزار');?>
Before inserting data to mysql $postdata = InputFilter($postdata, 'encode'); Getting data from MySQL $row= InputFilter($row, 'decode'); The data converts to Unicode entities, you don't need to decode it, except for file names or...
<?php
/*    ***********************************************
 *    Function reset_magic_quotes($data)
 *    ***********************************************/
function reset_magic_quotes($data){
    if(
get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
        if(
is_array($data)){
            
$data array_map("reset_magic_quotes"$data);
       
?>
<?php
/* $bytes = filesize($file); */
function formatBytes($bytes$precision 2) {
    
$units = array('B''KB''MB''GB''TB');
  
    
$bytes max($bytes0);
    
$pow floor(($bytes log($bytes) : 0) / log(1024));
    
$pow min($powcount($units) - 1);
  
    
$bytes /= pow(1024$pow);
    
$ensize = array('KB''MB''GB''TB''B');
    
$kusize = array('کیلۆ بایت''مێگا بایت''گێگا بایت''تێڕا بایت''بایت');
    
    return 
round($bytes$precision) . ' ' .?>
<?php
function GetMime($file){
 
$file basename($file);
 
$ext =    substr(strrchr($file"."), 1);
$mimes = array(
  
"*" => "application/octet-stream"
  
"" => "application/octet-stream"
  
"0" => "application/octet-stream"
  
false => "application/octet-stream"
  
null => "application/octet-stream"
  
"ac" => "text/plain"
  
"acx" => "application/internet-property-stream"
  
"ai" => "application/postscript"
  
"aif" => "audio/x-aiff"
  
"aifc" => "audio/x-aiff"
  
"aiff" => "audio/x-aiff"
  
"asc" => "text/plain"
  
"asf" => "video/x-ms-asf"
  
"asr" => "video/x-m?>
<?php
function KuNumber($number){
        
$en =array('0''1''2''3''4''5''6''7''8''9');
        
$ku =array('٠''١''٢''٣''٤''٥''٦''٧','٨''٩');
        
        return 
str_replace($en$ku$number);
}
?>

<?php
echo <<<A
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dir</title>
</head>

<body>
A;
$dir        = !empty($_POST['dir'])??>
Many Times Globality of variables will be the small issue, after long time I decided to use super globals. Super globals exists any where: $_SERVER, $_GET, $_POST .....
<?php
$to      
$_POST['to'];
$email   $_POST['email'];
$name    $_POST['name'];
$subject $_POST['subject'];
$comment $_POST['message'];

$To          strip_tags($to);
$TextMessage =strip_tags(nl2br($comment),"?>