Hai sekarang saya akan memposting Praktikum PHP5
Pertama Buat New File denngan nama Header_Utama.php dan ketikkan scriptnya seperti gambar di bawah
Kedua Buat New File lagi dengan nama Footer_Utama.php dan ketik scriptnya juga
Kemudian Buat New File lagi dengan nama content_utama.php
Kemudian Buat New File lagi dengan nama utama.php untuk menggabungkan semua file yang sudah di buat menjadi satu tampilan web
Preview di browser anda, maka hasilnya akan tampak seperti gambar di bawah
Selesai
Terima Kasih
Rabu, 11 Desember 2013
PHP 6
Saya akan Posting PHP 6
Pertama buat New File dengan nama Form
Kemudian ketikkan script di bawah ini
<?php
session_start();
if(isset($_SESSION['error'])){
$error = $_SESSION['error'];
$true = $_SESSION['true'];
$_POST = $_SESSION['post'];
unset ($_SESSION['error']);
unset ($_SESSION['true']);
unset ($_SESSION['post']);
}
if (empty($nama) || empty($gender) || empty($email) || empty($alamat) || empty($tempat) || empty($email) || empty($pwd) || empty($agama) || empty($noHP) || empty($captcha) || empty($hari) ||empty($bualan) ||empty($bulan) ){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="button.css" />
<title>Formulir</title>
</head>
<body style="background-image:url(y.jpg); background-repeat:repeat;">
<form action="action.php" name="form1" method="post">
<table cellspacing="0" cellpadding="4" bgcolor="#FFFFFF" border="0" width="700" height="420" Style='border-radius:0px;border-color:white;
box-shadow: 0 0 5px 5px black; position:fixed;left:350px;top:55px;border-top-right-radius:20px;border-top-left-radius:20px;'>
<tr>
<td rowspan="10" width="230" Style=' border-top-left-radius:0px;border-bottom-left-radius:0px '><center><img src="moklet.jpg" width="200" 0height="200" /></center></td>
<td colspan="3" Style=' border-top-right-radius:20px; '>
<center><strong><font color="white">INPUTAN BIODATA</font></strong></center>
</td>
</tr>
<tr>
<td> Nama Lengkap</td>
<td width="1"><center>:</center></td>
<td><input type='text' name="nama" size="40" placeholder="Nama Lengkap" value="<?php echo isset($_POST['nama']) ? $_POST['nama'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['nama']) ? $error['nama'] : '';?></font>
<font ><?php echo isset ($true['nama'])? $true['nama'] : '';?></font>
</td>
</tr>
<tr>
<td> Jenis Kelamin</td>
<td><center>:</center></td>
<td>
Laki-Laki<input type="radio" name="gender" value="<?php echo isset($_POST['gender']) ? $_POST['gender'] : ''; ?>Laki - Laki <?php echo isset($_POST['gender']) ? ' checked' : ''; ?>"/>
Perempuan<input type="radio" name=gender value="<?php echo isset($_POST['gender']) ? $_POST['gender'] : ''; ?> Perempuan <?php echo isset($_POST['gender']) ? ' checked' : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['gender']) ? $error['gender'] : '';?></font>
<?php echo isset ($true['gender'])? $true['gender'] : '';?>
</td>
</tr>
<tr>
<td>TTL</td>
<td><center>:</center></td>
<td>
<input type='text' placeholder="Tempat" name="tempat" size="4" value="<?php echo isset($_POST['tempat']) ? $_POST['tempat'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['tempat']) ? $error['tempat'] : '';?></font>
<font ><?php echo isset ($true['tempat'])? $true['tempat'] : '';?></font>
<?php
$bulan=array("Januari" ,"Februari", " Maret" ,"April", "Mei", "Juni",
"Juli", "Agustus", "September", "Oktober", "November", "Desember");
echo '<select name="hari" >';
echo "<option value=hari>Hari</option>";
$hari=1;
$haripilih = isset($_POST['hari']) ? $_POST['hari'] : "hari";
while($hari<=31) {
echo "<option value=$hari";
echo $hari == $haripilih ? " selected" : "";
echo '>'.$hari.'</option>';
$hari++;
}
echo '</select>';
echo '<select name="bulan">';
echo "<option value=bulan>Bulan</option>";
$jumlah=count($bulan);
$bulanpilih = isset($_POST['bulan']) ? $_POST['bulan'] : "bulan";
for($i=0; $i<$jumlah ; $i++){
echo "<option value=$bulan[$i]";
echo $bulan[$i] == $bulanpilih ? " selected" : "";
echo '>'.$bulan[$i].'</option>';
}
echo '</select>';
echo '<select name="tahun">';
echo "<option value=tahun>Tahun</option>";
$tahunpilih = isset($_POST['tahun']) ? $_POST['tahun'] : "tahun";
for($tahun=1995; $tahun<2010; $tahun++){
echo "<option value='$tahun'";
echo $tahun == $tahunpilih? " selected" : "";
echo '>'.$tahun.'</option>';
}
echo '</option>';
?>
</td>
</tr>
<tr>
<td>Alamat</td>
<td><center>:</center></td>
<td><input type='text' placeholder="Alamat" name="alamat" size="40" value="<?php echo isset($_POST['alamat']) ? $_POST['alamat'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['alamat']) ? $error['alamat'] : '';?></font>
<font ><?php echo isset ($true['alamat'])? $true['alamat'] : '';?></font>
</td>
</tr>
<tr>
<td>E-mail</td>
<td><center>:</center></td>
<td><input type='text' name="email" placeholder="E-mail" size="40" value="<?php echo isset($_POST['email']) ? $_POST['email'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['email']) ? $error['email'] : '';?></font>
<font ><?php echo isset ($true['email'])? $true['email'] : '';?></font>
</td>
</tr>
<tr>
<td>Password</td>
<td><center>:</center></td>
<td><input type='password' placeholder="Password" name="pwd" size="40" value="<?php echo isset($_POST['pwd']) ? $_POST['pwd'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['pwd']) ? $error['pwd'] : '';?></font>
<font ><?php echo isset ($true['pwd'])? $true['pwd'] : '';?></font>
</td>
</tr>
<tr>
<td>No. HP</td>
<td><center>:</center></td>
<td><input type='text' placeholder="No.HP" name="HP" size="40" value="<?php echo isset($_POST['HP']) ? $_POST['HP'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['HP']) ? $error['HP'] : '';?></font>
<font ><?php echo isset ($true['HP'])? $true['HP'] : '';?></font>
</td>
</tr>
<tr>
<td>Captcha <img height="30" style="vertical-align:middle;" src="captcha.php?data=<?php echo date('YmdHis');?> alt="securiy image" /></td>
<td><center>:</center></td>
<td>
<input name="pin" placeholder="Captcha" type="text" value="<?php echo isset($_POST['captcha']) ? $_POST['captcha'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['pin']) ? $error['pin'] : '';?></font>
<font ><?php echo isset ($true['pin'])? $true['pin'] : '';?></font>
</td>
</tr>
<tr>
<td colspan="3" Style=' border-bottom-right-radius:0px;'><center><button type="reset" value="Refresh" ONCLICK="history.go(0)"> Reset </button>
<button type="submit" name="submit"> Kirim </button></center>
</td>
</tr>
</table>
</form>
<?php } ?>
</body>
</html>
Kemudian buat New File lagi dengan nama action
Ketikkan script di bawah ini
<?php
session_start();
if($_POST){
$nama=$_POST['nama'];
$gender=isset($_POST['gender'])? $_POST['gender']:"";
$tempat=$_POST['tempat'];
$hari=$_POST['hari'];
$bulan=$_POST['bulan'];
$tahun=$_POST['tahun'];
$alamat=$_POST['alamat'];
$email=$_POST['email'];
$pwd=$_POST['pwd'];
$noHP=$_POST['HP'];
$CAPTCHA=$_POST['pin'];
$emailpattern = '/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/';
$imgTrue ='<img src="images/true.png" style="vertical-align:middle"/>
';
$imgEmp ='<img src="images/empty.png" style="vertical-align:middle"/>
';
$imgErr ='<img src="images/error.png" style="vertical-align:middle"/>
';
$error = array();
if(empty ($nama)){
$error['nama'] = $imgEmp.'Nama tidak boleh kosong';
} else if(preg_match('/[^a-zA-Z ]/', $nama)) {
$error['nama'] = $imgErr.'Nama hanya mengandung huruf saja';
} else{
$true['nama'] = $imgTrue;
}
if(empty ($email)){
$error['email'] = $imgEmp.'Email tidak boleh kosong';
} elseif (!preg_match($emailpattern, $email)){
$error['email'] = $imgErr.'Email salah tulis (xxxxxxx@xxxxx.xxx)';
} else{
$true['email'] = $imgTrue;
}
if(empty ($alamat)){
$error['alamat'] = $imgEmp.'Alamat tidak boleh kosong';
} else{
$true['alamat'] = $imgTrue;
}
if(empty ($pwd)){
$error['pwd'] = $imgEmp.'Password tidak boleh kosong';
} else{
$true['pwd'] = $imgTrue;
}
if (empty($gender)){
$error['gender'] = $imgEmp.'Anda tidak berjenis kelamin';
} else{
$true['gender'] = $imgTrue;
}
if(empty ($tempat)){
$error['tempat'] = $imgEmp.'TTL tidak boleh kosong';
} else{
$true['tempat'] = $imgTrue;
}
if(empty ($noHP)){
$error['HP'] = $imgEmp.'No HP tidak boleh kosong';
} else if(preg_match('/[^0-9 ]/', $noHP)) {
$error['HP'] = $imgErr.'Nama hanya mengandung angka aja';
}
else{
$true['HP'] = $imgTrue;
}
if(empty ($CAPTCHA)){
$error['pin'] = $imgEmp.'Captcha tidak boleh kosong';
} elseif (md5($_POST['pin']) <> $_SESSION['image_random_value']){
$error['pin'] = $imgErr.'Anda bukan manusia';
} else {
$true['pin'] = $imgTrue;
}
if(empty($error)){
if($gender=='Laki - Laki'){
echo'<h2><center>Selamat Datang Saudara, '.$nama.'
Berikut Biodatamu</center></h2>';
}
else{
echo'<h2><center>Selamat Datang Saudari, '.$nama.'
Berikut Biodatamu</center></h2>';
}
print("
<table cellspacing='0' cellpadding='4' bgcolor='#FFFFFF' border='1' width='650' height='300' Style='border-radius:20px;border-color:white; position:fixed;left:360px;top:110px;box-shadow: 0 0 5px 5px black; '>
<tr>
<td colspan='4' bgcolor='#F90' Style=' border-top-left-radius:20px; border-top-right-radius:20px'>
<center><strong><font color='white'><div class='Da'>DATA DIRI</div></font></strong></center>
</td>
</tr>
<tr>
<td> Nama Lengkap </td>
<td width='1'><center>:</center></td>
<td> $nama</td>
</tr>
<tr>
<td> Jenis Kelamin</td>
<td><center>:</center></td>
<td> $gender </td>
</tr>
<tr>
<td>TTL</td>
<td><center>:</center></td>
<td>$tempat, $hari - $bulan - $tahun</td>
</tr>
<tr>
<td>Alamat</td>
<td><center>:</center></td>
<td> $alamat</td>
</tr>
<tr>
<td>E-mail</td>
<td><center>:</center></td>
<td>$email</td>
</tr>
<tr>
<td>Password</td>
<td><center>:</center></td>
<td> $pwd</td>
</tr>
<tr>
<td Style=' border-bottom-left-radius:20px'>No. HP</td>
<td><center>:</center></td>
<td>$noHP</td>
</tr>
<tr>
</table>
");
}
else{
$_SESSION['error']=$error;
$_SESSION['true'] =$true;
$_SESSION['post'] =$_POST;
header("location:form.php");
}
}
?>
Kemudian buat New File lagi dengan nama captcha
Ketikkan script di bawah
<?php
session_start();
$alphaNumeric = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$random = substr(str_shuffle($alphaNumeric), 0, 5);
$image = imagecreatefromjpeg("background.jpg");
$textcolor = imagecolorallocate ($image, 0, 0, 0); //black
imagestring ($image, 5, 5, 8, $random, $textcolor);
$_SESSION['image_random_value'] = md5($random);
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
Selesai
Terima Kasih
Pertama buat New File dengan nama Form
Kemudian ketikkan script di bawah ini
<?php
session_start();
if(isset($_SESSION['error'])){
$error = $_SESSION['error'];
$true = $_SESSION['true'];
$_POST = $_SESSION['post'];
unset ($_SESSION['error']);
unset ($_SESSION['true']);
unset ($_SESSION['post']);
}
if (empty($nama) || empty($gender) || empty($email) || empty($alamat) || empty($tempat) || empty($email) || empty($pwd) || empty($agama) || empty($noHP) || empty($captcha) || empty($hari) ||empty($bualan) ||empty($bulan) ){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="button.css" />
<title>Formulir</title>
</head>
<body style="background-image:url(y.jpg); background-repeat:repeat;">
<form action="action.php" name="form1" method="post">
<table cellspacing="0" cellpadding="4" bgcolor="#FFFFFF" border="0" width="700" height="420" Style='border-radius:0px;border-color:white;
box-shadow: 0 0 5px 5px black; position:fixed;left:350px;top:55px;border-top-right-radius:20px;border-top-left-radius:20px;'>
<tr>
<td rowspan="10" width="230" Style=' border-top-left-radius:0px;border-bottom-left-radius:0px '><center><img src="moklet.jpg" width="200" 0height="200" /></center></td>
<td colspan="3" Style=' border-top-right-radius:20px; '>
<center><strong><font color="white">INPUTAN BIODATA</font></strong></center>
</td>
</tr>
<tr>
<td> Nama Lengkap</td>
<td width="1"><center>:</center></td>
<td><input type='text' name="nama" size="40" placeholder="Nama Lengkap" value="<?php echo isset($_POST['nama']) ? $_POST['nama'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['nama']) ? $error['nama'] : '';?></font>
<font ><?php echo isset ($true['nama'])? $true['nama'] : '';?></font>
</td>
</tr>
<tr>
<td> Jenis Kelamin</td>
<td><center>:</center></td>
<td>
Laki-Laki<input type="radio" name="gender" value="<?php echo isset($_POST['gender']) ? $_POST['gender'] : ''; ?>Laki - Laki <?php echo isset($_POST['gender']) ? ' checked' : ''; ?>"/>
Perempuan<input type="radio" name=gender value="<?php echo isset($_POST['gender']) ? $_POST['gender'] : ''; ?> Perempuan <?php echo isset($_POST['gender']) ? ' checked' : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['gender']) ? $error['gender'] : '';?></font>
<?php echo isset ($true['gender'])? $true['gender'] : '';?>
</td>
</tr>
<tr>
<td>TTL</td>
<td><center>:</center></td>
<td>
<input type='text' placeholder="Tempat" name="tempat" size="4" value="<?php echo isset($_POST['tempat']) ? $_POST['tempat'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['tempat']) ? $error['tempat'] : '';?></font>
<font ><?php echo isset ($true['tempat'])? $true['tempat'] : '';?></font>
<?php
$bulan=array("Januari" ,"Februari", " Maret" ,"April", "Mei", "Juni",
"Juli", "Agustus", "September", "Oktober", "November", "Desember");
echo '<select name="hari" >';
echo "<option value=hari>Hari</option>";
$hari=1;
$haripilih = isset($_POST['hari']) ? $_POST['hari'] : "hari";
while($hari<=31) {
echo "<option value=$hari";
echo $hari == $haripilih ? " selected" : "";
echo '>'.$hari.'</option>';
$hari++;
}
echo '</select>';
echo '<select name="bulan">';
echo "<option value=bulan>Bulan</option>";
$jumlah=count($bulan);
$bulanpilih = isset($_POST['bulan']) ? $_POST['bulan'] : "bulan";
for($i=0; $i<$jumlah ; $i++){
echo "<option value=$bulan[$i]";
echo $bulan[$i] == $bulanpilih ? " selected" : "";
echo '>'.$bulan[$i].'</option>';
}
echo '</select>';
echo '<select name="tahun">';
echo "<option value=tahun>Tahun</option>";
$tahunpilih = isset($_POST['tahun']) ? $_POST['tahun'] : "tahun";
for($tahun=1995; $tahun<2010; $tahun++){
echo "<option value='$tahun'";
echo $tahun == $tahunpilih? " selected" : "";
echo '>'.$tahun.'</option>';
}
echo '</option>';
?>
</td>
</tr>
<tr>
<td>Alamat</td>
<td><center>:</center></td>
<td><input type='text' placeholder="Alamat" name="alamat" size="40" value="<?php echo isset($_POST['alamat']) ? $_POST['alamat'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['alamat']) ? $error['alamat'] : '';?></font>
<font ><?php echo isset ($true['alamat'])? $true['alamat'] : '';?></font>
</td>
</tr>
<tr>
<td>E-mail</td>
<td><center>:</center></td>
<td><input type='text' name="email" placeholder="E-mail" size="40" value="<?php echo isset($_POST['email']) ? $_POST['email'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['email']) ? $error['email'] : '';?></font>
<font ><?php echo isset ($true['email'])? $true['email'] : '';?></font>
</td>
</tr>
<tr>
<td>Password</td>
<td><center>:</center></td>
<td><input type='password' placeholder="Password" name="pwd" size="40" value="<?php echo isset($_POST['pwd']) ? $_POST['pwd'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['pwd']) ? $error['pwd'] : '';?></font>
<font ><?php echo isset ($true['pwd'])? $true['pwd'] : '';?></font>
</td>
</tr>
<tr>
<td>No. HP</td>
<td><center>:</center></td>
<td><input type='text' placeholder="No.HP" name="HP" size="40" value="<?php echo isset($_POST['HP']) ? $_POST['HP'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['HP']) ? $error['HP'] : '';?></font>
<font ><?php echo isset ($true['HP'])? $true['HP'] : '';?></font>
</td>
</tr>
<tr>
<td>Captcha <img height="30" style="vertical-align:middle;" src="captcha.php?data=<?php echo date('YmdHis');?> alt="securiy image" /></td>
<td><center>:</center></td>
<td>
<input name="pin" placeholder="Captcha" type="text" value="<?php echo isset($_POST['captcha']) ? $_POST['captcha'] : ''; ?>" />
<font size="-1" color="red"><?php echo isset($error['pin']) ? $error['pin'] : '';?></font>
<font ><?php echo isset ($true['pin'])? $true['pin'] : '';?></font>
</td>
</tr>
<tr>
<td colspan="3" Style=' border-bottom-right-radius:0px;'><center><button type="reset" value="Refresh" ONCLICK="history.go(0)"> Reset </button>
<button type="submit" name="submit"> Kirim </button></center>
</td>
</tr>
</table>
</form>
<?php } ?>
</body>
</html>
Kemudian buat New File lagi dengan nama action
Ketikkan script di bawah ini
<?php
session_start();
if($_POST){
$nama=$_POST['nama'];
$gender=isset($_POST['gender'])? $_POST['gender']:"";
$tempat=$_POST['tempat'];
$hari=$_POST['hari'];
$bulan=$_POST['bulan'];
$tahun=$_POST['tahun'];
$alamat=$_POST['alamat'];
$email=$_POST['email'];
$pwd=$_POST['pwd'];
$noHP=$_POST['HP'];
$CAPTCHA=$_POST['pin'];
$emailpattern = '/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/';
$imgTrue ='<img src="images/true.png" style="vertical-align:middle"/>
';
$imgEmp ='<img src="images/empty.png" style="vertical-align:middle"/>
';
$imgErr ='<img src="images/error.png" style="vertical-align:middle"/>
';
$error = array();
if(empty ($nama)){
$error['nama'] = $imgEmp.'Nama tidak boleh kosong';
} else if(preg_match('/[^a-zA-Z ]/', $nama)) {
$error['nama'] = $imgErr.'Nama hanya mengandung huruf saja';
} else{
$true['nama'] = $imgTrue;
}
if(empty ($email)){
$error['email'] = $imgEmp.'Email tidak boleh kosong';
} elseif (!preg_match($emailpattern, $email)){
$error['email'] = $imgErr.'Email salah tulis (xxxxxxx@xxxxx.xxx)';
} else{
$true['email'] = $imgTrue;
}
if(empty ($alamat)){
$error['alamat'] = $imgEmp.'Alamat tidak boleh kosong';
} else{
$true['alamat'] = $imgTrue;
}
if(empty ($pwd)){
$error['pwd'] = $imgEmp.'Password tidak boleh kosong';
} else{
$true['pwd'] = $imgTrue;
}
if (empty($gender)){
$error['gender'] = $imgEmp.'Anda tidak berjenis kelamin';
} else{
$true['gender'] = $imgTrue;
}
if(empty ($tempat)){
$error['tempat'] = $imgEmp.'TTL tidak boleh kosong';
} else{
$true['tempat'] = $imgTrue;
}
if(empty ($noHP)){
$error['HP'] = $imgEmp.'No HP tidak boleh kosong';
} else if(preg_match('/[^0-9 ]/', $noHP)) {
$error['HP'] = $imgErr.'Nama hanya mengandung angka aja';
}
else{
$true['HP'] = $imgTrue;
}
if(empty ($CAPTCHA)){
$error['pin'] = $imgEmp.'Captcha tidak boleh kosong';
} elseif (md5($_POST['pin']) <> $_SESSION['image_random_value']){
$error['pin'] = $imgErr.'Anda bukan manusia';
} else {
$true['pin'] = $imgTrue;
}
if(empty($error)){
if($gender=='Laki - Laki'){
echo'<h2><center>Selamat Datang Saudara, '.$nama.'
Berikut Biodatamu</center></h2>';
}
else{
echo'<h2><center>Selamat Datang Saudari, '.$nama.'
Berikut Biodatamu</center></h2>';
}
print("
<table cellspacing='0' cellpadding='4' bgcolor='#FFFFFF' border='1' width='650' height='300' Style='border-radius:20px;border-color:white; position:fixed;left:360px;top:110px;box-shadow: 0 0 5px 5px black; '>
<tr>
<td colspan='4' bgcolor='#F90' Style=' border-top-left-radius:20px; border-top-right-radius:20px'>
<center><strong><font color='white'><div class='Da'>DATA DIRI</div></font></strong></center>
</td>
</tr>
<tr>
<td> Nama Lengkap </td>
<td width='1'><center>:</center></td>
<td> $nama</td>
</tr>
<tr>
<td> Jenis Kelamin</td>
<td><center>:</center></td>
<td> $gender </td>
</tr>
<tr>
<td>TTL</td>
<td><center>:</center></td>
<td>$tempat, $hari - $bulan - $tahun</td>
</tr>
<tr>
<td>Alamat</td>
<td><center>:</center></td>
<td> $alamat</td>
</tr>
<tr>
<td>E-mail</td>
<td><center>:</center></td>
<td>$email</td>
</tr>
<tr>
<td>Password</td>
<td><center>:</center></td>
<td> $pwd</td>
</tr>
<tr>
<td Style=' border-bottom-left-radius:20px'>No. HP</td>
<td><center>:</center></td>
<td>$noHP</td>
</tr>
<tr>
</table>
");
}
else{
$_SESSION['error']=$error;
$_SESSION['true'] =$true;
$_SESSION['post'] =$_POST;
header("location:form.php");
}
}
?>
Kemudian buat New File lagi dengan nama captcha
Ketikkan script di bawah
<?php
session_start();
$alphaNumeric = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$random = substr(str_shuffle($alphaNumeric), 0, 5);
$image = imagecreatefromjpeg("background.jpg");
$textcolor = imagecolorallocate ($image, 0, 0, 0); //black
imagestring ($image, 5, 5, 8, $random, $textcolor);
$_SESSION['image_random_value'] = md5($random);
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header('Content-type: image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
Maka hasilnya akan tampak seperti gambar di bawah
Terima Kasih
PHP 4
Buka Dreamweaver CS6, kemudian buat New File dengan nama Form2
Ketikkan script di bawah ini
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="script2.php">
<table><tr><td>
<table width="353" border="0">
<tr>
<td width="84"><b>Nama</b></td>
<td width="15">:</td>
<td width="232"><input name="nama" type="text" id="nama2" /></td>
</tr>
<tr>
<td><b>Email</b></td>
<td>:</td>
<td><input name="email" type="text" id="nama" /></td>
</tr>
<tr>
<td><b>Jenis Kelamin</b></td>
<td>:</td>
<td><b> </b>
<input name="gender" type="radio" value="L" />
Laki-laki
<input name="gender" type="radio" value="P" />
Perempuan</td>
</tr>
<tr>
<td><b>Umur</b></td>
<td>:</td>
<td><select name="umur" >
<option value="0-29">Di bawah 30</option>
<option value="30-60">Antara 30 s/d 60</option>
<option value="60+">Di atas 60</option>
</select></td>
</tr>
<td><b>Tanggal Lahir</b></td>
<td>:</td>
<td><?php
//membuat array bulan
$bulan=array("Januari" ,"Februari", " Maret" ,"April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember");
//membuat combo box hari
echo '<select name="hari">';
$hari=1;
while($hari<=31) {
echo "<option value=\"$hari\">$hari</option>";
$hari++;
}
echo '</select>';
//membuat combo box bulan
echo '<select name="bulan">';
$jumlah=count($bulan);
for($i=0; $i<$jumlah ; $i++){
echo '<option value="'.$bulan[$i].'">'.$bulan[$i].'</option>';
}
echo '</select>';
//membuat combo box tahun
echo '<select name="tahun">';
for($tahun=2000; $tahun<2010; $tahun++){
echo "<option value=\"$tahun\">$tahun</option>";
}
echo '</select>';
?>
</td>
<tr>
<td><b>Komentar</b></td>
<td>:</td>
<td><textarea name="komentar" cols="30" rows="4" ></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Buat New File lagi dengan nama script2
Kemudian ketikkan script di bawah
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
//membuat variabel
$nama=$_REQUEST['nama'];
$email=$_REQUEST['email'];
$gender=$_REQUEST['gender'];
$umur=$_REQUEST['umur'];
$hari=$_REQUEST['hari'];
$bulan=$_REQUEST['bulan'];
$tahun=$_REQUEST['tahun'];
$komentar=$_REQUEST['komentar'];
//menampilkan data yang diterima
if($gender=='L'){
echo "Selamat Datang Saudara,.$nama.<br>";
}else{
echo "Selamat Datang Saudari,.$nama.<br>";
}
echo "TERIMA KASIH ATAS KOMENTAR ANDA<BR>";
echo "Nama : $nama<br>";
echo "Email : $email<br>";
echo "Jenis Kelamin : $gender<br>";
echo "Umur : $umur<br>";
echo "Tanggal Lahir : $hari-$bulan-$tahun<br>";
echo "Komentar : <br>";
echo $komentar;
?>
</body>
</html>
Preview di browser anda
Maka hasilnya akan seperti di bawah ini
Selesai
Terima Kasih atas perhatiannya
asp6
Kali ini saya akan memposting tentang Praktikum ASP6
Pertama buat New Project dengan nama ValidasiForm
Lalu ketikkan script di bawah ini
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ValidasiForm.aspx.cs" Inherits="Bab3.Tugas.ValidasiForm" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="MyStyle.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.auto-style3 {
width: 160px;
}
</style>
</head>
<body Style="background-image:url(atraw.png);background-repeat:repeat;">
<form id="form1" runat="server">
<center>
<div>
<asp:ValidationSummary ID="vsSum" CssClass="div" runat="server" Width="286px"
ShowMessageBox="true" />
</div><br />
<center>
<table bgcolor="#DAD4BF" class="f" width="710" border="0" style="border-radius:20px ;">
<tr>
<th colspan="4">INPUT DATA DIRI</th>
</tr>
<tr>
<td rowspan="7">
<center><img src="logotelkom.jpg" height="160px" />
</td>
</tr>
<tr>
<td class="auto-style1">Nama Lengkap :</td>
<td class="auto-style3">
<asp:TextBox ID="txtNama" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="rfvNama" runat="server" ControlToValidate="txtNama"
CssClass="RequiredFieldValidator" ErrorMessage="Nama harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center' />Nama Harus Diisi.." />
</td>
</tr>
<tr>
<td class="auto-style1">NIS :</td>
<td class="auto-style3">
<asp:TextBox ID="txtNIS" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="cvNIS1" runat="server" ControlToValidate="txtNIS"
CssClass="RequiredFieldValidator" ErrorMessage="NIS harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>NIS harus diisi" />
<asp:CustomValidator ID="cvNIS" runat="server" ControlToValidate="txtNIS"
OnServerValidate="cvNIS_ServerValidate2"
CssClass="RequiredFieldValidator" ErrorMessage="NIS harus 13 angka"
Text="<img src='stacks_image_91.png' width='25px' class='center'/>NIS harus 13 angka" />
</td>
</tr>
<tr>
<td class="auto-style1">Umur :</td>
<td class="auto-style3">
<asp:TextBox ID="txtUmur" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="rfvUmur1" runat="server" ControlToValidate="txtUmur"
CssClass="RequiredFieldValidator" ErrorMessage="Umur harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Umur harus diisi" />
<asp:RangeValidator ID="rfvUmur" runat="server" ControlToValidate="txtUmur"
MinimumValue="4" MaximumValue="99" Type="Integer"
CssClass="RequiredFieldValidator" ErrorMessage="Range Umur 4-99 tahun.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Range Umur 4-99 tahun.." />
</td>
</tr>
<tr>
<td class="auto-style1">Email :</td>
<td class="auto-style3">
<asp:TextBox ID="txtEmail" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="rfvEmail1" runat="server" ControlToValidate="txtEmail"
CssClass="RequiredFieldValidator" ErrorMessage="Email harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Email harus diisi" />
<asp:RegularExpressionValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail"
CssClass="RequiredFieldValidator" ErrorMessage="Email format salah" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Text="<img src='stacks_image_91.png' width='25px' class='center' />Email format salah" />
</td>
</tr>
<tr>
<td class="auto-style1">Password :</td>
<td class="auto-style3">
<asp:TextBox ID="txtPass" runat="server" Width="169px" Height="30px" TextMode="Password" ></asp:TextBox>
</td>
<td> <asp:RequiredFieldValidator ID="cvPass" runat="server" ControlToValidate="txtPass"
CssClass="RequiredFieldValidator" ErrorMessage="Password harus diisi"
Text="<img src='stacks_image_91.png' width='25px' class='center' />Password harus diisi" />
</td>
</tr>
<tr>
<td class="auto-style1">Confirm Password :</td>
<td class="auto-style3">
<asp:TextBox ID="txtConfirm" runat="server" Width="169px" Height="30px" TextMode="Password"></asp:TextBox>
</td>
<td> <asp:RequiredFieldValidator ID="cvConfirm1" runat="server" ControlToValidate="txtConfirm"
CssClass="RequiredFieldValidator" ErrorMessage="Confirm Password harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Confirm Password harus diisi" />
<asp:CompareValidator ID="cvConfirm" runat="server" ControlToValidate="txtPass" ControlToCompare="txtConfirm"
CssClass="RequiredFieldValidator" ErrorMessage="Confirm harus sama dengan Password"
Text="<img src='stacks_image_91.png' width='25px' class='center' />Confrim harus sama dengan password" />
</td>
</tr>
</table>
<br />
<asp:Button ID="KIRIM" runat="server" Text="Daftar" Height="36px" Width="145px" PostBackUrl="~/Tugas/ValidasiFormResult.aspx" />
</center>
</form>
</body>
</html>
Buat New Project lagi dengan nama ValidasiFormResult
Lalu ketikkan script di bawah
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ValidasiFormResult.aspx.cs" Inherits="Bab3.Tugas.ValidasiFormResult" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center">
<tr>
<td>
<asp:Label ID="lblNama" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblNIS" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblUmur" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblEmail" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblPassword" runat="server"></asp:Label><br />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Preview di browser anda
Maka hasilnya akan sama seperti di bawah ini
Semoga Bermanfaat :D
Pertama buat New Project dengan nama ValidasiForm
Lalu ketikkan script di bawah ini
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ValidasiForm.aspx.cs" Inherits="Bab3.Tugas.ValidasiForm" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="MyStyle.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.auto-style3 {
width: 160px;
}
</style>
</head>
<body Style="background-image:url(atraw.png);background-repeat:repeat;">
<form id="form1" runat="server">
<center>
<div>
<asp:ValidationSummary ID="vsSum" CssClass="div" runat="server" Width="286px"
ShowMessageBox="true" />
</div><br />
<center>
<table bgcolor="#DAD4BF" class="f" width="710" border="0" style="border-radius:20px ;">
<tr>
<th colspan="4">INPUT DATA DIRI</th>
</tr>
<tr>
<td rowspan="7">
<center><img src="logotelkom.jpg" height="160px" />
</td>
</tr>
<tr>
<td class="auto-style1">Nama Lengkap :</td>
<td class="auto-style3">
<asp:TextBox ID="txtNama" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="rfvNama" runat="server" ControlToValidate="txtNama"
CssClass="RequiredFieldValidator" ErrorMessage="Nama harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center' />Nama Harus Diisi.." />
</td>
</tr>
<tr>
<td class="auto-style1">NIS :</td>
<td class="auto-style3">
<asp:TextBox ID="txtNIS" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="cvNIS1" runat="server" ControlToValidate="txtNIS"
CssClass="RequiredFieldValidator" ErrorMessage="NIS harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>NIS harus diisi" />
<asp:CustomValidator ID="cvNIS" runat="server" ControlToValidate="txtNIS"
OnServerValidate="cvNIS_ServerValidate2"
CssClass="RequiredFieldValidator" ErrorMessage="NIS harus 13 angka"
Text="<img src='stacks_image_91.png' width='25px' class='center'/>NIS harus 13 angka" />
</td>
</tr>
<tr>
<td class="auto-style1">Umur :</td>
<td class="auto-style3">
<asp:TextBox ID="txtUmur" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="rfvUmur1" runat="server" ControlToValidate="txtUmur"
CssClass="RequiredFieldValidator" ErrorMessage="Umur harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Umur harus diisi" />
<asp:RangeValidator ID="rfvUmur" runat="server" ControlToValidate="txtUmur"
MinimumValue="4" MaximumValue="99" Type="Integer"
CssClass="RequiredFieldValidator" ErrorMessage="Range Umur 4-99 tahun.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Range Umur 4-99 tahun.." />
</td>
</tr>
<tr>
<td class="auto-style1">Email :</td>
<td class="auto-style3">
<asp:TextBox ID="txtEmail" runat="server" Width="165px" Height="30px"></asp:TextBox></td>
<td> <asp:RequiredFieldValidator ID="rfvEmail1" runat="server" ControlToValidate="txtEmail"
CssClass="RequiredFieldValidator" ErrorMessage="Email harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Email harus diisi" />
<asp:RegularExpressionValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail"
CssClass="RequiredFieldValidator" ErrorMessage="Email format salah" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Text="<img src='stacks_image_91.png' width='25px' class='center' />Email format salah" />
</td>
</tr>
<tr>
<td class="auto-style1">Password :</td>
<td class="auto-style3">
<asp:TextBox ID="txtPass" runat="server" Width="169px" Height="30px" TextMode="Password" ></asp:TextBox>
</td>
<td> <asp:RequiredFieldValidator ID="cvPass" runat="server" ControlToValidate="txtPass"
CssClass="RequiredFieldValidator" ErrorMessage="Password harus diisi"
Text="<img src='stacks_image_91.png' width='25px' class='center' />Password harus diisi" />
</td>
</tr>
<tr>
<td class="auto-style1">Confirm Password :</td>
<td class="auto-style3">
<asp:TextBox ID="txtConfirm" runat="server" Width="169px" Height="30px" TextMode="Password"></asp:TextBox>
</td>
<td> <asp:RequiredFieldValidator ID="cvConfirm1" runat="server" ControlToValidate="txtConfirm"
CssClass="RequiredFieldValidator" ErrorMessage="Confirm Password harus diisi.."
Text="<img src='stacks_image_91.png' width='25px' class='center'/>Confirm Password harus diisi" />
<asp:CompareValidator ID="cvConfirm" runat="server" ControlToValidate="txtPass" ControlToCompare="txtConfirm"
CssClass="RequiredFieldValidator" ErrorMessage="Confirm harus sama dengan Password"
Text="<img src='stacks_image_91.png' width='25px' class='center' />Confrim harus sama dengan password" />
</td>
</tr>
</table>
<br />
<asp:Button ID="KIRIM" runat="server" Text="Daftar" Height="36px" Width="145px" PostBackUrl="~/Tugas/ValidasiFormResult.aspx" />
</center>
</form>
</body>
</html>
Buat New Project lagi dengan nama ValidasiFormResult
Lalu ketikkan script di bawah
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ValidasiFormResult.aspx.cs" Inherits="Bab3.Tugas.ValidasiFormResult" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center">
<tr>
<td>
<asp:Label ID="lblNama" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblNIS" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblUmur" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblEmail" runat="server"></asp:Label><br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblPassword" runat="server"></asp:Label><br />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Preview di browser anda
Maka hasilnya akan sama seperti di bawah ini
Semoga Bermanfaat :D
Minggu, 08 Desember 2013
asp5
Klai ini saya akan posting, tugas asp5 saya tentang form
buat item baru di solution yang kita buat untuk praktikum asp5, berinama InputBiodata
ketikan script dibawah ini
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InputBiodata.aspx.cs" Inherits="Bab2.InputBiodata" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Inputan</title>
<link rel="stylesheet" type="text/css" href="nah.css" />
<style>
.f {
font-family: Verdana;
}
.auto-style1 {
width: 712px;
}
#Reset1 {
height: 27px;
width: 64px;
}
</style>
</head>
<body Style="background-image:url(a1.jpg);background-repeat:repeat;">
<form id="form1" runat="server">
<center>
<h2>
<span style="color: white; font-family: Adler;">FORM PENDAFTARAN </span></h2>
<table class="f" cellspacing="0" cellpadding="7" bgcolor="#FFFFFF" border="0" width="450" height="200" Style='border-color:white; border-radius: 20px;
box-shadow: 0 0 2px 2px white;'>
<tr>
<td rowspan="9" width="250" Style=' border-top-left-radius:20px;border-bottom-left-radius:20px '><center><img src="logo.jpg" width="200" 0height="200" /></center></td>
<td colspan="3" Style=' border-top-right-radius:20px; '>
<center><font color="red" font size="6">INPUTAN BIODATA</font></center>
</td>
</tr>
<tr>
<td> Nama </td>
<td width="1"><center>:</center></td>
<td><asp:TextBox ID="nama" type="text" Size="35" runat="server"
></asp:TextBox></td>
</tr>
<tr>
<td> Jenis
Kelamin</td>
<td><center>:</center></td>
<td class="auto-style1">
<asp:radiobutton groupname="Gender" id="rbtLaki" runat="server" text="Laki-Laki"></asp:radiobutton>
<asp:radiobutton groupname="Gender" id="rbtPerempuan" runat="server" text="Perempuan"></asp:radiobutton>
</td>
</tr>
<tr>
<td>E-mail</td>
<td><center>:</center></td>
<td><asp:TextBox ID="Email" type="text" Size="35" runat="server"
></asp:TextBox></td>
</tr>
<tr>
<td>Password</td>
<td><center>:</center></td>
<td><asp:TextBox ID="pwd" type="password" Size="35" runat="server"
></asp:TextBox></td>
</tr>
<tr>
<td>Alamat</td>
<td><center>:</center></td>
<td>
<asp:TextBox ID="alamat" TextMode="MultiLine" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Cita -
Cita</td>
<td><center>:</center></td>
<td class="auto-style1">
<asp:radiobutton groupname="Cita" id="rbtCita1" runat="server" text="Kuliah"></asp:radiobutton>
<br />
<asp:radiobutton groupname="Cita" id="rbtCita2" runat="server" text="Kerja"></asp:radiobutton>
<br />
<asp:radiobutton groupname="Cita" id="Cita3" runat="server" text="Yang lain">
</asp:radiobutton>
<asp:button id="btnOther" onclick="btnOther_Click" runat="server" style="background-color: cornsilk; border-radius: 5px;" text="Pilih"></asp:button>
<asp:panel id="pnlOther" runat="server" visible="false">Isi Sendiri:
<asp:textbox id="CitaLain" runat="server"></asp:textbox></asp:panel>
</td>
</tr>
<tr>
<td colspan="3" style=' border-bottom-right-radius:20px;'><center>
<asp:button id="prev" onclick="prev_Click" runat="server" style="background-color: antiquewhite; border-radius: 10px;" text="Preview Di Bawah"></asp:button>
<asp:Button ID="btnSubmit" runat="server" style="background-color: cornsilk; border-radius: 10px;" Text="Submit" PostBackUrl="IBiodataHasil.aspx" Height="27px" Width="56px" OnClick="btnSubmit_Click"></asp:Button> </center>
</td>
</tr>
</table>
<table aria-dropeffect="popup" width="450" border="0" id="Table1" runat="server" style="background-color: white; border-radius: 20px;">
<tr>
<td bgcolor="#000000" colspan="3" style="border-top-left-radius: 20px; border-top-right-radius: 20px;"><center>
<b><span style="color: white;"><h2>Preview</h2>
</span></b></center>
</td>
</tr>
<tr>
<td width="99">Nama</td>
<td width="19">:</td>
<td width="180">
<asp:label id="lblNama1" runat="server"></asp:label></td>
</tr>
<tr>
<td>Jenis
Kelamin</td>
<td>:</td>
<td>
<asp:label id="lblGender1" runat="server"></asp:label></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><asp:label id="lblEmail1" runat="server"></asp:label></td>
</tr>
<tr>
<td>Password</td>
<td>:</td>
<td><asp:label id="lblPassword1" runat="server"></asp:label></td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td><asp:label id="lblAlamat1" runat="server"></asp:label></td>
</tr>
<tr>
<td style="border-bottom-left-radius: 20px;">Cita-Cita</td>
<td>:</td>
<td style="border-bottom-right-radius: 20px;"><asp:label id="lblCita1" runat="server"></asp:label></td>
</tr>
</table>
</center>
</form>
</body>
</html>
Lalu buat item baru untuk menampilkan data hasil berinama IBiodataHasil
ketikan script dibawah ini:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IBiodataHasil.aspx.cs" Inherits="Bab2.IBiodataHasil" %>
<%@ PreviousPageType VirtualPath="~/InputBiodata.aspx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Hasil</title>
<link rel="stylesheet" type="text/css" href="nah.css" />
<style type="text/css">
.labelStyle {
color: red;
}
</style>
</head>
<body Style="background-image:url(a1.jpg);background-repeat:repeat;">
<form id="form1" runat="server"><center>
<font face="Adler" color="white">
<asp:Label ID="Label1" runat="server"></asp:Label></font>
<center><table cellspacing='0' cellpadding='6' bgcolor='#FFFFFF' border='0' width='450' height='300' Style='border-radius:10px;border-color:white; box-shadow: 0 0 2px 2px white; '>
<tr>
<td colspan='3' bgcolor="#000000" Style=' border-top-left-radius:10px; border-top-right-radius:10px'>
<center><strong><font color='white'>DATA DIRI</font></strong></center>
</td>
</tr>
<tr>
<td> Nama
Lengkap </td>
<td width='1'><center>:</center></td>
<td><asp:Label ID="lblNama" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr>
<td> Jenis
Kelamin</td>
<td><center>:</center></td>
<td><asp:Label ID="lblGender" runat="server" ></asp:Label></td>
</tr>
<tr>
<td>E-mail</td>
<td><center>:</center></td>
<td><asp:Label ID="lblEmail" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr>
<td>Password</td>
<td><center>:</center></td>
<td><asp:Label ID="lblPwd" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr>
<td>Alamat</td>
<td><center>:</center></td>
<td><asp:Label ID="lblAlamat" runat="server" ></asp:Label></td>
</tr>
<tr>
<td Style=' border-bottom-left-radius:20px'>Cita - Cita</td>
<td><center>:</center></td>
<td Style=' border-bottom-Right-radius:20px'><asp:Label ID="lblCita" runat="server" ></asp:Label></td>
</tr>
<tr>
<td colspan="3"> <center>Data dimasukkan pukul <asp:Label ID="lblTime" runat="server" Text="Label" Font-Size="Large"
CssClass="labelStyle"/></center></td>
</tr>
</table></center>
</form>
</body>
</html>
Nah ini hasilnya
Langganan:
Postingan (Atom)













