Posted: Oktober 31, 2010 in PHP_SELF
Tag:

PHP_SELF

<!doctype html public “-//W3C//DTD HTML 4.0 //EN”>
<html>
<head>
<title>Title here!</title>
</head>
<body>
<form method=POST action=<?php_self?>>
<table border=2 width=70% bgcolor=#00FFFF cellspacing=2 align=center>
<tr><td colspan=3 align=center> DATA NILAI SISWA </td></tr>
<tr><td>NIM</td><td>:</td><td><input type=”text” name=NIM></td></tr>
<tr><td>NAMA</td><td>:</td><td><input type=”text” name=NAMA></td></tr>
<tr><td>Jurusan</td><td>:</td><td><input type=”radio” name=mi>MI<input type=”radio” name=ka>KA</td></tr>
<tr><td>Gender</td><td>:</td><td><input type=”radio”name=l>Laki-Laki<input type=”radio” name=p>Perempuan</td></tr>
<tr><td>Alamat</td><td>:</td><td><textarea rows=0 cols=0 wrap=”off” name=alamat></textarea></td></tr>
<tr><td colspan=3 align=center><input type=”submit” value=Proses><input type=”reset” value=”Cancel”></td></tr>
</table></form>
<?
$NIM=$HTTP_POST_VARS[“NIM”];
$NAMA=$HTTP_POST_VARS[“NAMA”];
$TUGAS=$HTTP_POST_VARS[“NTUGAS”];
$UTS=$HTTP_POST_VARS[“NUTS”];
$UAS=$HTTP_POST_VARS[“NUAS”];
ECHO”<CENTER>”;
ECHO”NIM MAHASISWA        $NIM<br>”;
ECHO”NAMA MAHASISWA       $NAMA<br>”;
ECHO”ANDA MENDAPAT NILAI:<br>”;
ECHO”TUGAS       :   $TUGAS<br>”;
ECHO”UTS         :   $UTS<br>”;
ECHO”UAS         :   $UAS<br>”;
$RATA=($TUGAS+$UTS+$UAS)/3;
ECHO”DENGAN NILAI RATA-RATA   :  $RATA<br>”;
IF($RATA>=80)
{$GRADE=”A”;
$KET=”SANGAT BAIK”;}
ELSEIF($RATA>=70)
{$GRADE=”B”;
$KET=”BAIK”;}
ELSEIF($RATA>=56)
{$GRADE=”C”;
$KET=”CUKUP BAIK”;}
ELSEIF($RATA>=46)
{$GRADE=”D”;
$KET=”KURANG”;}
ELSE
{ECHO”<FONTCOLOR=#FF0000>”;$GRADE=”E”;
$KET=”MAAF ANDA MENDAPAT GRADE E”;ECHO”</FONT>”;}
ECHO”DENGAN GRADE:,$GRADE<br>”;
ECHO”KETERANGAN:,$KET<br>”;
?>
</body>
</html>

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s