• 1
  • 1
  • 1
  • 1
  • 1
assalm......n.....wasslm..

25 Agu 2009

contoh tampilan script

ini scriptnya :

< ?php
header(" Content-Type:image/jpeg" );
$background=@imagecreate(100,100);
$kuning=imagecolorallocate($background,250,250,300);
$hitam=imagecolorallocate($background,0,0,0);
imagearc($background,50,50,50,50,0,360,$hitam);
imageJPEG($background);
imagedestroy($background);
? >








< ?php
header(" Content-Type:image/jpeg" );
$background=@imagecreate(100,100);
$kuning=imagecolorallocate($background,250,250,300);
$hitam=imagecolorallocate($background,0,0,0);
imagearc($background,50,50,50,50,0,360,$hitam);
imageJPEG($background);
imagedestroy($background);
? >



< ?php
$a = 2;
$b = 15;

print " \$a = $a dan \$b = $b <br> " ;

if ($a > $b)
{
print ;" Nilai a lebih besar dari nilai b;" ;
}
else
{
print ;" Nilai a lebih kecil dari nilai b;" ;
}
?>




< ?php
$kalimat = " Belajar PHP" ;
$jumlah=strlen($kalimat);
print " variabel string \$kalimat = $kalimat < br> " ;
print " Kalimat '$kalimat' diatas jumlah karakternya adalah $jumlah " ;
? >





< ?php
$cfile = " datapengunjung.dat" ;
$fh = fopen($cfile, " r+" );

if (!$fh){
die(" <BR> Gagal membuka file < I> $cfile< /I> . " );
}
$s = fgets($fh, 6);

$hitung = (int) $s;
$hitung = $hitung + 1;
$hitung = str_pad($hitung, 6);

rewind($fh);
fwrite($fh, $hitung);

echo " Anda pengunjung ke $hitung" ;

fclose($fh);
? >



< ?php
$dir = opendir(" ./ " );

while ($baca_file = readdir($dir))
{
echo " $baca_file" , " \n" ;
}
closedir($dir);
? >

0 komentar:

Posting Komentar

facebook class

figence_class on Facebook

Seberapa lama web/blog anda? jika lebih dari 100 KB berarti blog anda lola

Your domain(s): Enter each address on a new line (Maximum 10)
 
(eg. iwebtool.com)    
 

Powered by iWEBTOOL