Skip to content

Tugas PHP Kasus Perbandingan

June 1, 2012

Nama Anggota :

1. Ari Kusuma Wardana (08018363

2. Wakhid Nur Hadi   (09018071)

3. Azis Kurniawan       (09018083)

4. Hanif Fikrianto        (09018112)

5. Puji Triyono              (09018131)

coding :

<?php

$action=$_SERVER[‘PHP_SELF’];

echo “<form method=post action=$action>”;
echo “Nilai i : <input type=text name=var1 size=10><br>”;
echo “Nilai j : <input type=text name=var2 size=10><input type=’submit’ value=’proses’ name=’buttonproses’>
</form>
“;

if($_POST[‘buttonproses’]==’proses’){
$var1=$_POST[‘var1’];
$var2=$_POST[‘var2’];

echo “Nilai i = $var1 dan Nilai j = $var2<br>”;

if($var1==$var2){
echo “Nilai I sama dengan Nilai J”;
}

elseif($var1<$var2){
echo “Nilai I lebih kecil dari Nilai J”;
}

else {
echo “Nilai J lebih kecil dari Nilai I”;
}

}

?>

From → Pemrograman WEB

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: