P. 1
sintak

sintak

|Views: 50|Likes:
Published by enasafnikal

More info:

Published by: enasafnikal on Jun 24, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

11/19/2013

pdf

text

original

Contoh sintak stok. <?

php //stok penjualan barang $bln_ini=1250; $ptghn_bln=725; $akhir_bln=2120; $terjual=235; $laba=125000; echo "1 jumlah stok barang pada awal bulan $bln_ini kodi"; echo "<br>2 jumlah stok barang masuk $akhir_bln kodi"; echo "<br>3 jumlah barang terjual pertengahan bulan $ptghn_bln kodi"; echo "<br>4 jumlah barang terjual akhir bulan $terjual kodi"; $total= $bln_ini+$akhir_bln; echo "<br>5 total stok barang pada akhir bulan $total"; $jml= $ptghn_bln+$terjual; echo "<br>6 total barang terjual pada bulan ini $jml"; $hasil= $total-$jml; echo "<br>7 sisa stok barang pada akhir bulan $hasil"; $untung= $jml*$laba; echo "<br>8 omset penjualan bulan ini $untung"; Biodata: <html><head><title>bodata pribadi saya</title></head><body><pre><form action=proses_ena_safnikal.php method=post>Nama : <input type=text Name=nama =size=20></b><BR>Npm : <input type=text name=npm maxlength=12><br>Alamat : <input type=text name=alamat size=20><br>Tempat/Tgl. Lahir : <input type=text name=Ttl size=20><br> </pre><input type=submit value=Kirim> <input type=reset value=Batal></body></html Proses: <?php//menangkap formulir data mahasiswaprint"<Pre>nama :$nama </pre>"; print"<pre>npm :$npm</pre>";print"<pre>alamat :$alamat </pre>"; print"<pre>Tempat/tgl. lahir :$Ttl</pre>";?> Contoh operator: <?PHP//contoh penggunaan operator $a = 1; $b = 2; // penggunaan operator +$hasil_jml=$a+$b; echo"hasil penjumlahan $a+$b=$hasil_jml"; ?> Contoh operator perbandingan: <?php//berikut contoh operator perbandingan $a=10; $b=5; $c=5; printf("$a<$b ->%d <br>\n",$a<$b); printf("$a>$b ->%d <br>\n",$a>$b); printf("$b= =$c ->%d <br>\n",$b==$c);printf("$b!=$c ->%d <br>\n",$b!=$c); printf("$a<>$b ->%d <br>\n",$a<>$b); ?>

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->