Skip to content

Instantly share code, notes, and snippets.

@heriipurnama
Created June 2, 2015 23:33
Show Gist options
  • Save heriipurnama/781fa1a0069387de7282 to your computer and use it in GitHub Desktop.
Save heriipurnama/781fa1a0069387de7282 to your computer and use it in GitHub Desktop.
UX user WEb
<html>
<body>
<?php
echo"<form action=' ' method='get'>
Nama : <input type='text' name='nama' > <br>
Jumlah Anak : <input type='text' name='jum'><br>
<input type='submit' name='proses' value='Oke'>
</form>";
if(isset($_GET['jum'])){
$jum = $_GET['jum'];
$nama = $_GET['nama'];
echo "<form action='tugas.php' method='get'>";
echo"<input type='text' name='jumku' value=$jum><br>";
echo"<input type='text' name='nama' value=$nama><br><br>";
for ($i=1; $i <= $jum ; $i++) {
echo "Nama Anak ke $i = <input type='text' name='juml[$i]'> <br>";
}
echo "<input type='submit' name='proses1' value='Proses Anak'>";
echo "</form>";
}
?>
</body>
</html>
<?php
$nama=$_GET['nama'];
$jumku=$_GET['jumku'];
$juml=$_GET['juml'];
echo"======Data Yang Dimasukkan=====<br>";
echo"Nama : $nama<br>";
echo "Jumlah Anak :$jumku Orang <br><br>";
foreach ($juml as $jumlq) {
echo "Nama Anak :$jumlq <br>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment