Senin, 14 Maret 2011

UTS WEB

1. Script php

< !DOCTYPE html >
< html lang="en" >
< head >
< title > Tugas UTS WEB < /title >
< /head >
< body >
< dr >
< h1 > =:Sign Up Form:= < /h1 >
< FORM ACTION=" < ?php $_SERVER['PHP_SELF'];? > " METHOD="POST" >
Nama : < br > < dd > < input type="text" size="25" name="nama"
value=" < ?php
echo isset($_POST['nama']) ? $_POST['nama'] : '';
? > "
/ > < br > < /dd >
< dd >
< ?php
$nama = $_POST["nama"];
if (isset($nama)){
if (empty($nama)){
echo 'data Nama masih kosong';}
else
echo '';}
? > < /dd >
Email: < br > < dd > < input type="text" size="25" name="email"
value=" < ?php
echo isset($_POST['email']) ? $_POST['email'] : '';
? > "
/ > < br > < /dd >
< dd >
< ?php
$email = $_POST["email"];
if (isset($email)){
if (empty($email)){
echo 'data Email masih kosong';}
else
echo '';}
? > < /dd >
Alamat: < br > < dd > < input type="text" size="25" name="alamat"
value=" < ?php
echo isset($_POST['alamat']) ? $_POST['alamat'] : '';
? > "
/ > < br > < /dd >
< dd >
< ?php
$alamat = $_POST["alamat"];
if (isset($alamat)){
if (empty($alamat)){
echo 'data Alamat masih kosong';}
else
echo '';}
? > < /dd >
Kota: < br > < dd > < input type="text" size="25" name="kota"
value=" < ?php
echo isset($_POST['kota']) ? $_POST['kota'] : '';
? > "
/ > < br > < /dd >
< dd >
< ?php
$kota = $_POST["kota"];
if (isset($kota)){
if (empty($kota)){
echo 'data Kota masih kosong';}
else
echo '';}
? > < /dd >
Kode Pos: < br > < dd > < input type="text" size="25" name="kode"
value=" < ?php
echo isset($_POST['kode']) ? $_POST['kode'] : '';
? > "
/ > < br > < /dd >
< dd >
< ?php
$kode = $_POST["kode"];
if (isset($kode)){
if (empty($kode)){
echo 'data Kode Pos masih kosong';}
else
echo '';}
? > < /dd >
< br > < dd > < input type="submit" value="Process" / > < /dd > < /dr >
< ?php
if ((isset($_POST['nama'])) && (isset($_POST['email'])) && (isset($_POST['alamat'])) && (isset($_POST['kota'])) && (isset($_POST['kode'])))
{echo ' < br > Data Anda : ';
echo ' < br > Nama : ' . $_POST['nama'];
echo ' < br > Email : ' . $_POST['email'];
echo ' < br > Alamat : ' . $_POST['alamat'];
echo ' < br > Kota : ' . $_POST['kota'];
echo ' < br > Kode Pos : ' . $_POST['kode'];}
? >
< /form >
< /body >
< /html >


2. printscreen sebelum data dimasukkan




3. printscreen setelah data dimasukkan

Tidak ada komentar: