i need help

From: Date: Thu, 08 Nov 2001 08:48:33 +0000
Subject: i need help
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-7342@lists.php.net to get a copy of this message
i have a messages like this: Warning: php_network_getaddresses: gethostbyname failed in c:\inetpub\wwwroot\yeniweb\code\kontrat_tl.php on line 12 Warning: fopen("http://www.tcmb.gov.tr/kurlar/today.html","r") - No error in c:\inetpub\wwwroot\yeniweb\code\kontrat_tl.php on line 12 Warning: Supplied argument is not a valid File-Handle resource in c:\inetpub\wwwroot\yeniweb\code\kontrat_tl.php on line 17 Warning: Supplied argument is not a valid File-Handle resource in c:\inetpub\wwwroot\yeniweb\code\kontrat_tl.php on line 17 can i get rid of them? for the following source code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> <title>TL. Bazlı Kontrat Birim Fiyat Listesi</title> <meta http-equiv="Content-Type" content="text/html; charset="> <link rel="stylesheet" href="deneme.css" type="text/css"> </head> <?php file://Merkez Bankası sayfasından dolar kurunun alınma işlemi file://Sayfa yapısında herhangi bir değişiklik olursa program çalışmayacaktır $fp = fopen ("http://www.tcmb.gov.tr/kurlar/today.html", "r"); $i=0; while ($i<12){ $buf = fgets($fp,4096); if ($i==3 || $i==4){ print($buf); } $i=$i+1; } $dol=substr($buf,38,9); $j=0; $k=0; $dolar=" "; for ($i=0;$i<9;$i++) { if ($dol[$i]==',') { $first=substr($dol,$j,$k); $j=$i+1; $k=-1; $dolar=$dolar.$first; } $k=$k+1; } $second=substr($dol,6,3); $dolar.=$second; print"<b>DÖVİZ SATIŞ : ";print($dolar); print" TL. </b>"; print "<br>"; file://$tarih=filectime("kontrat_tl.txt"); ?> <h4><?php file://print date("D d M Y",$tarih); ?></h4> <?php print "<center><table border=3>"; $fbaslik = fopen("kontrat_tl_baslik.txt","r");//baslikların bulunduğu dosya okuma amaçlı açılıyor $buffer = fgets($fbaslik,1024); $dizi = explode("\t",$buffer); print "<tr>"; print "<th colspan=4 >$dizi[0]</th>";//Dosyanın ilk satırındaki başlıkları yazdırır. print "<th colspan=3 >$dizi[4]</th>"; print "<th colspan=3 >$dizi[7]</th>"; print "<th colspan=3 >$dizi[10]</th>"; print "<th colspan=3 >$dizi[13]</th>"; print "<th colspan=3 >$dizi[16]</th>"; print "<th colspan=3 >$dizi[19]</th>"; print "</tr>"; print "<tr>"; $buf = fgets($fbaslik,4096); $dizi = explode("\t",$buf); $say=sizeof($dizi); for($j=0;$j<$say;$j++) { $deg=trim($dizi[$j]); print "<th align=center>$deg</th>";//Dosyanın 2.satırındaki başlıkları yazdırır. } print "</tr>"; fclose($fbaslik); $fp = fopen("kontrat_tl.txt","r"); $aylikfaiz=0.06;//aylık faiz oranı şu an 0.06 değiştiği zaman buradan değiştirilecek $sure=3; $pesinyuzdesi=0.25; $ust=pow(($aylikfaiz+1),$sure); $k=($aylikfaiz*pow(($aylikfaiz+1),$sure))/(pow((1+$aylikfaiz),$sure)-1);//"k" değeri bulunuyor for ($i=0;$i<6;$i++)//her oran için m değeri bulunup "m" arrayine atılıyor { $m[$i]=($sure*$k)/((1-$pesinyuzdesi)+($pesinyuzdesi*$sure*$k)); $pesinyuzdesi=$pesinyuzdesi+0.05; }//end for $toplam=array(0,0,0,0,0,0); while (!feof($fp)) { $buffer = fgets($fp,1024); $arr = explode("\t",$buffer); $sayac=sizeof($arr); print "<tr>"; if (trim($arr[2])=="-")//kdv'li ve kdv'siz satışlar için ürünün peşin fiyatının hesaplanması { $pesin=$pesin*1.18; } else { $pesin=$dolar*$arr[2]; } $a=trim($arr[2]); $b="-"; for($i=0; $i<6;$i++)//ürünlerin her oran için toplam fiyatlarının hesaplanması { if ($a==$b) { $toplam[$i]=$toplam[$i]*1.18; } else { $toplam[$i]=$dolar*$m[$i]*$arr[2]; } }//end for $yuzde=0.25; for($i=0; $i<10;$i++)//değerlerin tabloya atılması { switch ($i) { case 0: case 1: print "<td align=left>$arr[$i]</td>"; break; case 2: print "<td align=middle>$arr[$i]</td>"; break; case 3: print "<td align=right>".round($pesin,3)."</td>"; break; default: { $ilkay=round($toplam[$i-4]*$yuzde); $sonay=round(($toplam[$i-4]-$ilkay)/3); print "<td align=right>$ilkay</td>"; print "<td align=right>$sonay</td>"; print "<td align=right>".round($toplam[$i-4],3)."</td>"; $yuzde=$yuzde+0.05; } }//end switch }//end for print "</tr>"; }//end while fclose($fp);//dosya kapatılıyor ?> <body bgcolor="#FFFFFF" text="#000000"> </body> </html>

« previous php.mirrors (#7342) next »