Search the Community
Showing results for tags 'php mysql form'.
The search index is currently processing. Current results may not be complete.
Found 1 result
-
Salam pada otai-otai Putera.com ni. Saya cuma ingin minta pandangan tuan/puan tentang coding form saya ni, adakah coding saya ni nampak berterabur@tak tersusun? atau ia mmg ok mcmni? saya masih baru lagi dlm web dev mgunakan php ni. harap ada yg boleh bagi pendapat. terima kasih.. ini code saya. [CODE] <?php $s_name = "booking form beta 1.0"; echo "<html> <head><title>$s_name</title> </head> <body>"; /*Array Area*/ $namaBulan = array(1=> "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");$kereta['1'] = "Kelisa"; $kereta['2'] = "Viva"; /*End of Array Area*/ echo "<div align='center'> <h2>PLEASE FILL THE FORM TO ORDER</h2>\n $s_name </div> <hr color='red'>";$today = Time(); #dapatkan masa sekarang $bulansekarang = date("m" ,$today); #dapatkan bulan sekarang dgn menggunakan variable $today echo "<form action='processform.php' method='post'> <table width='50%'> <tr> <td align='right'> <b>Nama:<input type='text' name='pname' /><br /> <b>Alamat:<input type='text' name='paddress' /><br /> <b>No.IC<input type='text' name='pic' /><br />"; /*start bahagian tarikh dan list kereta*/ echo "<b>Tarikh Order:<select name='dateMO'>\n"; for ($n=1 ;$n<=12;$n++) { echo "<option value=$n"; if ($bulansekarang == $n) #tambah attribute today { echo " selected"; } echo "> $namaBulan[$n]\n"; #ambil array $namaBulan } echo "</select>"; $todayDay= date("d" , $today); echo "<select name='dateDay'>\n"; for ($n=1;$n<=31;$n++) { echo " <option value=$n"; if ($todayDay == $n ) { echo " selected"; } echo "> $n\n"; }echo "</select>"; $startYr = date("Y" , $today); echo "<select name='dateYr'>\n"; for ($n=$startYr;$n<=$startYr+3;$n++) { echo "<option value=$n"; if ($startYr == $n ) { echo " selected"; } echo"> $n\n"; } echo "</select><br />"; echo "<b>Tarikh Pulang:<select name='dateMO'>\n"; for ($n=1 ;$n<=12;$n++) { echo "<option value=$n"; if ($bulansekarang == $n) #tambah selected attribute { echo " selected"; } echo "> $namaBulan[$n]\n"; #ambil array $namaBulan } echo "</select>"; $todayDay= date("d" , $today); echo "<select name='dateDay'>\n"; for ($n=1;$n<=31;$n++) { echo " <option value=$n"; if ($todayDay == $n ) { echo " selected"; } echo "> $n\n"; } echo "</select>"; $startYr = date("Y" , $today); echo "<select name='dateYr'>\n"; for ($n=$startYr;$n<=$startYr+3;$n++) { echo "<option value=$n"; if ($startYr == $n ) { echo " selected"; } echo"> $n\n"; } echo "</select>\n</table></tr></td>"; echo "<table width='40%'> <tr><td align='right'> <b>Kereta:</b> <select name='kereta'> "; echo "<option value=''>Pilih Kereta</option>"; for ($i=1;$i<=2;$i++) { echo " <option value='$kereta'>$kereta[$i]</option>"; } echo "</table></tr></td> <table width='85%'> <tr><td align='center'>"; echo "\n<input type='submit' value='Hantar' />"; ?>[/CODE]