Selasa, 29 Mei 2012

Pemograman web

Nama Anggota Kelompok:
1. Bayu Kurnia Hidayat 11018168
2. Sinung Swasta 11018183
3. Harry Wahyu Saputra 11018186


Form Input Menggunakan ASP

[sourcecode language="php"]

<html>
<head>
<title>Formi Input ASP</title>
</head>
<body>
<center>
<h1>
Form Input Menggunakan ASP
</center></h1>
<hr>
<center><form Method="Get" Action="formasp.Asp" Name="FrmASP">
<table width="300" border="4" cellspacing="1" cellpadding="5">

<td>NIM</td><td><Input Type="Text" Name="TxtNIM" Size=12></td></tr>
<td>Nama</td><td><Input Type="Text" Name="TxtNama" Size=25></td><tr>
<td>Alamat</td><td><Input Type="Text" Name="TxtAlamat" Size=35></td><tr>
<td>Jenis Kelamin</td><td><input type="radio" value="L" name="jenis kelamin">Laki-laki</td>
<td><input type="radio" value="P" name="jenis kelamin">Perempuan</td></tr>
<td>Agama</td><td><select name="Agama">
<option>Islam</option>
<option>Kristen</option>
<option>Katolik</option>
<option>Hindu</option>
<option>Budha</option></tr>
</select>
<td>Dosen Favorit</td><td><Input Type="Text" Name="TxtDosen" Size=25></td><tr>
<td>Komentar</td><td><textarea rows="4" name="Komentar" cols="20"></textarea></td><tr>
<td Colspan=3 align=middle>
<Input Type="Submit" Value="Simpan" Name="CmdSimpan">
<Input Type="Reset" Value="Batal" Name="CmdBatal"></td>

</table>
</form>
</body>
</html>

[/sourcecode]
Perulangan for, while, dan do while menggunakan PHP
[sourcecode language="php"]
<html>
<head>
<title>Perulangan Menggunakan PHP</title>
</head>
<body>
<center>
<h1>
Perulangan for, while, dan do while
</center></h1>
<hr>
<center>
<table width="180" border="4" cellspacing="1" cellpadding="5">
<tr>
<td>
<?php

//Perulangan For
echo "Perulangan for:"."<br />";
for($i=1;$i<=5;$i++){
echo "for ".$i ."<br />";
}

//Perulangan While
echo "Perulangan while:"."<br />";
$i=6;
while($i<=10)
{
echo "while " . $i . "<br />";
$i++;
}

//Perulangan do while
echo "Perulangan do While:"."<br/>";
$i=10;
do
{
$i++;
echo "do while " . $i . "<br />";
}
while ($i<=15);

?>

</td>
</tr>
</table>
</center>
</body>
</html>
[/sourcecode]
Fungsi-fungsi PHP
[sourcecode language="php"]
<head>
<title>Fungsi-Fungsi PHP</title>
</head>
<body>
<center>
<h1>
Fungsi-Fungsi PHP
</center></h1>
<hr>
<center>
<table width="400" border="4" cellspacing="1" cellpadding="5">
<tr>
<td>
<?php
$yesterday = mktime(0,0,0,date("m"),date("d")-1,date("Y"));
echo "Kemarin Tanggal ".date("d-F-Y", $yesterday)."<br/>";
echo "Sekarang Tanggal ".date("d-F-Y")."<br/>";
$tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));
echo "Besok Tanggal ".date("d-F-Y", $tomorrow)."<br/>";

echo "Memecah string dengan string(explode): ".$sentence = "Fungsi fungsi PHP "."<br/>";
$word = explode(" ", $sentence);
print_r($word);
echo ""."<br/>"."<br/>";

$string="Fungsi fungsi PHP";
echo "Kalimat: ".($string)."<br/>";
echo "Dibalik: ".strrev($string)."<br/>";
echo "Konversi MD5: ".md5($string)."<br/>";
echo "Banyak Karakter: ".strlen($string)."<br>";

?>
</td>
</tr>
</table>
</center>
</body>
</html>
[/sourcecode]

Komentar :

ada 0 komentar ke “Pemograman web”

Posting Komentar

Pengikut

Total Tayangan Halaman

 
This Blog is proudly powered by Blogger.com | Template by Harry wahyu saputra