0% found this document useful (0 votes)
10 views1 page

PHP Modul 171

This document provides a basic PHP tutorial that includes a form for updating student information such as NIM, name, address, sex, and date of birth. The form is generated using PHP echo statements, with options for selecting day, month, and year. The tutorial emphasizes the simplicity of creating forms in PHP.

Uploaded by

dev.edossmjo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

PHP Modul 171

This document provides a basic PHP tutorial that includes a form for updating student information such as NIM, name, address, sex, and date of birth. The form is generated using PHP echo statements, with options for selecting day, month, and year. The tutorial emphasizes the simplicity of creating forms in PHP.

Uploaded by

dev.edossmjo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Basic PHP Tutorial http://blog.rosihanari.

net

$bln = $pecahTgl[1];
$thn = $pecahTgl[0];

echo "<form method='post' action='update.php'>";


echo "<table>";
echo "<tr><td>NIM</td><td>:</td>
<td><input type='text' name='nim' value='".$data['nim']."'></td></tr>";
echo "<tr><td>Nama Mahasiswa</td><td>:</td>
<td><input type='text' name='nama' value='".$data['nama']."'></td></tr>";
echo "<tr><td>Alamat</td><td>:</td>
<td><textarea name='alamat'>".$data['alamat']."</textarea></td></tr>";
echo "<tr><td>Sex</td><td>:</td>
<td><input type='radio' name='sex' value='L'> Laki-Laki
<input type='radio' name='sex' value='P'> Perempuan</td></tr>";
echo "<tr><td>Tgl Lahir</td><td>:</td><td>
<select name='tgl'>";
for ($i=1; $i<=31; $i++)
{
if ($i == $tgl) echo "<option value='".$i."' selected>".$i."</option>";
else echo "<option value='".$i."'>".$i."</option>";
}
echo "</select>
<select name='bln'>";
for ($i=1; $i<=12; $i++)
{
if ($i == $bln) echo "<option value='".$i."' selected>".$i."</option>";
else echo "<option value='".$i."'>".$i."</option>";
}
echo "</select>
<select name='thn'>";
for ($i=1980; $i<=1997; $i++)
{
if ($i == $thn) echo "<option value='".$i."' selected>".$i."</option>";
else echo "<option value='".$i."'>".$i."</option>";
}
echo "</select>
</td></tr>";
echo "</table>";
echo "<input type='submit' name='submit' value='Submit'>";
echo "</form>";

?>

Nah… mudah dan simpel bukan idenya?

Disusun oleh : Rosihan Ari Yuana 171

You might also like