Hi Everybody,I am a newbie.I have problem with my website,who can fix error for me :
<?php
function HitCounter()
{
$counter_file = "../count.txt";
if (($fp = fopen($counter_file, "r"))) {
$counter_b = (int) fread($fp,20);
fclose($fp);
} else {
$counter_b = "Non posso aprire il file";
return $counter_b;
}
$counter_a = $counter_b + 1;
$fp = fopen($counter_file,"w");
fwrite($fp,$counter_a);
fclose($fp);
return $counter_b;
}
function gb2unicode($gb)
{
if(!trim($gb))
return $gb;
$filename="gb2312.txt";
$tmp=file($filename);
$codetable=array();
while(list($key,$value)=each($tmp))
$codetable[hexdec(substr($value,0,6))]=substr($value,9,4);
$utf="";
while($gb)
{
if (ord(substr($gb,0,1))>127)
{
$this=substr($gb,0,2); $gb=substr($gb,2,strlen($gb));
$utf.="&#x".$codetable[hexdec(bin2hex($this))-0x8080].";";
}
else
{
$gb=substr($gb,1,strlen($gb));
$utf.=substr($gb,0,1);
}
}
return $utf;
}
function unicode_to_utf8($str) {
$utf8 = '';
foreach( $str as $unicode ) {
if ( $unicode < 128 ) {
$utf8.= chr( $unicode );
} elseif ( $unicode < 2048 ) {
$utf8.= chr( 192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ) );
$utf8.= chr( 128 + ( $unicode % 64 ) );
} else {
$utf8.= chr( 224 + ( ( $unicode - ( $unicode % 4096 ) ) / 4096 ) );
$utf8.= chr( 128 + ( ( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ) );
$utf8.= chr( 128 + ( $unicode % 64 ) );
} // if
} // foreach
return $utf8;
} // unicode_to_utf8
function cutstring($mystring,$len){
// $mystring la xau can cat
$count=1;
$a="";
while ($count <=$len){
$pos = strpos ($mystring, " ");
$a=$a.substr($mystring,0,$pos+1);
$mystring=substr($mystring,($pos+1),strlen($mystring)-$pos);
$count++;
}
return $a;
}
function test($ngay)
{ $a='';
if ($ngay>2)
$a = $ngay.''.T1_ngay.'/ '.($ngay-1).' '.T1_night;
else if ($ngay==2)
$a= $ngay.''.T1_ngay.'/ '.($ngay-1).' '.T_night;
else
$a= '0'.T_ngay;
return $a;
}
function Processdate($strdate)
{
$year = substr($strdate,0,4);
$month = substr($strdate,4,2);
$day = substr($strdate,6,2);
if ($strdate == '') return '';
else
return $day.'/'.$month.'/'.$year;
}
?>
Error line 34