Senin, 23 September 2013

PHP Indonesia - Facebook: [ask]

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Manage your social media

Best social media tool for image publishing to Facebook and Twitter. Look amazing and delight your followers. Get 40% off when you sign up today.
From our sponsors
[ask] numpang nanya nih mastah,
Sep 24th 2013, 02:33, by Mahfud Yoga Nugroho

Mahfud Yoga Nugroho 2:33am Sep 24
[ask]
numpang nanya nih mastah,

<html>
<head>
<title> Pendaftaran </title>
</head>
<body>
<p><center><font size="60px"> Pengisian Data Siswa </font></p>

<form action="" method="post" >

<br><center>Nama:</br>
<br>
<center><input type="text" name="name" /></br>
<br>
<center>Kelas:</br>
<br><center><input type="text" name="kelas" /></br>
<br>
<center>No.abs:</br>
<br><input type="text" name="no" /></br>
<br>
<center>Hobi:</br>
<br><input type="text" name="hobi" /></br>
<br>
<center>Tanggal Lahir</br>

<br><center><select name="tgl">
<option selected="selected" > -Tanggal- </option>
<?php
for($a=1; $a<=31; $a+=1){
echo"<option value=$a> $a </option>";
}
?>
</select>

<select name="bln">
<option selected="selected">-Bulan-</option>
<?php
$bulan=array("Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember");
$jlh_bln=count($bulan);
for($c=0; $c<$jlh_bln; $c+=1){
echo"<option value=$bulan[$c]> $bulan[$c] </option>";
}
?>

</select>

<select name="thn">
<option selected="selected">-Tahun-</option>
<?php
$i = $_POST['thn'];
$umur = $_POST['umur'];
for($i=2020; $i>=1990; $i-=1){
echo"<option value=$i> $i </option>";
}

$umur = date("Y") - $i ;
?>
</select></br>
<br><center><input type="submit" value="Kirim" /></br>
</form>
<br>
<table border='1' width="600" align="center">
<tr>
<td><center>Nama</td>
<td ><center>Kelas</td>
<td ><center>No.abs</td>
<td ><center>Hobi</td>
<td ><center>Tanggal Lahir</td>
<td><center>Umur</td>
</tr>
<tr>
<td>
<?php echo $_POST["name"]; ?> </td>
<td>
<?php echo $_POST["kelas"]; ?> </td>
<td>
<?php echo $_POST["no"]; ?> </td>
<td>
<?php echo $_POST["hobi"]; ?> </td>
<td>
<?php echo $_POST["tgl"]; ?>

<?php echo $_POST["bln"]; ?>

<?php echo $_POST["thn"]; ?>
</td>
<td>
<?php echo ($umur); ?>
</td>
</tr>
</br>
</table>
<?php
$name = $_POST['name'];
$kelas = $_POST['kelas'];
$no = $_POST['no'];
$hobi = $_POST['hobi'];

if ($name == "" || $kelas =="" || $no =="" || $hobi =="")
{ echo "<br> Mohon isi data yang masih kosong </br>";}

?>
</body>
</html>

-->
di bagian $umur, umur
kok masih gak bener ya ?
trus biar tabel baru keluar stelah di klik submit gimana ya ?
help nya ya ..., :)

Muhammad Fuad Fachrudin 2:36am Sep 24
Form actionnya kok belum ditentukan?

Mahfud Yoga Nugroho 2:37am Sep 24
itu kan biar langsung keluar di page yang sama, dan di dalem tabel

Cahya Dsn 2:42am Sep 24
sekedar saran:
[1] jika masih bingung, pecahkan antara form inputan dan bagian prosesnya
[2] lihat lagi logiknya:
//..
$i = $_POST['thn'];
$umur = $_POST['umur'];
for($i=2020; $i>=1990; $i-=1){
echo"<option value=$i> $i </option>";
}
$umur = date("Y") - $i ;
//..
terakhir nilai $i=1990, sehingga dari pernyataan:
$umur = date("Y") - $i;
selalu bernilai:
$umur = date("Y") - 1990;

[3] bawah ane jagonya, ane gak bisa koding cuman asal koming ^_^V

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar