Minggu, 26 Mei 2013

php


biodata.php
<html>
<head><title>latihan.php</title>
<style type="text/css">
<!--
.style1 {font-family: "Showcard Gothic"}
body {
 background-color: #0033FF;
}
.style3 {font-family: "Times New Roman"}
-->
</style>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<pre>
<h1 class="style1">biodataku</h1>
<form action="proses.php" method="POST" name="input">
<span class="style3">nama depan      <input type="text" name="n_depan">
nama belakang <input type="text" name="n_belakang">
alamat                <input type="text" name="alamat">
umur</span>       <input type="text" name="umur"><br></pre>
jurusan<br>
<input type="radio" name="jurusan" value="rpl" checked>rpl<br>
<input type="radio" name="jurusan" value="tkr">tkr<br>
<input type="radio" name="jurusan" value="ak">ak<br>
mapel<br>
<input type="checkbox" name="php" value="php" checked>php<br>
<input type="checkbox" name="vb" value="vb">vb<br>
<input type="checkbox" name="html" value="html">html<br>
<input type="submit" name="ok" value="ok">
<input type="reset" name="batal" value="batal">
</form>
</body>
</html>
hasil:

  latihan.php

biodataku

nama depan nama belakang alamat umur
jurusan
rpl
tkr
ak
mapel
php
vb
html




proses.php
<style type="text/css">
<!--
body {
 background-color: #0033FF;
}
-->
</style><?php
if(isset($_POST['ok']))
{
$jurusan=$_POST['jurusan'];
$mapel1=$_POST['php'];
$mapel2=$_POST['vb'];
$mapel3=$_POST['html'];
$nd=$_POST['n_depan'];
$nb=$_POST['n_belakang'];
$a=$_POST['alamat'];
$u=$_POST['umur'];
echo" nama depan    = ".$nd."<br>";
echo" nama belakang = ".$nb."<br>";
echo" alamat        = ".$a."<br>";
echo" umur          = ".$u."<br>";
echo" jurusan       = ".$jurusan."<br>";
echo" mapel         = ".$mapel1;
}
?>

hasil:
nama depan:yuni
nama belakang:arsih
alamat:wonogiri
umur:16
jurusan:rpl
mapel:php

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | SharePoint Demo