note 55960 deleted from language.functions by victor
| From: | victor@php.net | Date: | Fri, 19 Aug 2005 04:27:08 +0000 |
| Subject: | note 55960 deleted from language.functions by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93870@lists.php.net to get a copy of this message | ||
Note Submitter: bunafit at akakom dot org
----
With function, we can make simple our program with make form function. and then we can load the
function in our form. You can see this sample Combo Box function. Like this:
<?php
function ComboBox($min, $max, $variabel) {
echo "<select name=$variabel>";
for($i=$min; $i <= $max; $i++) {
echo "<option value=$i>$i</option>";
}
echo "</select>";
}
?>
And then, we can load like this:
<html>
<head>
<title>Menggunakan Combo Box Seleksi nama</title>
</head>
<body>
<form action="SimpanProgram.php" method="post" name="form1"
target="_self">
<?php
include_once "FncComboBoxCek.php";
include_once "FncComboBoxCekBln.php";
$Bts=date('t'); // Jumlah hari
$Tgl=date('d'); // Tanggal sekarang
$Bln=date('m'); // Bulan sekarang
$Thn=date('Y'); // Tahun sekarang
echo "Tanggal penyetoran : ";
echo ComboBox(1,$Bts,'TglLahir',$Tgl);
echo ComboBoxBln(1,12,'BlnLahir',$Bln);
echo ComboBox(1980,$Thn,'ThnLahir',$Thn);
?>
</form>
</body>
</html>
Tranks from STUDENT OF STMIK AKAKOM - JOGJAKARTA - INDONESIA