|
|||||||
New to SitePoint Forums? Register here for free!
|
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Member
Join Date: Oct 2006
Location: Malaysia
Posts: 2
|
NEWBIE - Need help on FORM-POST
I have a file call "formisi.php"
<html> <head> <title>Form dan Elemen Form secara lengkap</title> </head> <body> <h1>Form dan berbagai elemennya</h1> <form name="form1" method="post" action="formhasil.php"> <table width="800" border="0"> <tr> <td width="175">Nama</td> <td width="615"><input type="text" name="nama" value="Maya" size="25" maxlength="50"></td> </tr> <tr> <td>Password</td> <td><input type="password" name="password" value="" size="15" maxlength="25"></td> </tr> <tr> <td>Gender</td> <td><input name="gender" type="radio" value="L" checked> Laki-laki -------- <input name="gender" type="radio" value="P"> Perempuan</td> </tr> <tr> <td>Hobby</td> <td><input type="checkbox" name="hobi1" value="Memancing"> Memancing</td> </tr> <tr> <td> </td> <td><input type="checkbox" name="hobi2" value="Belanja"> Belanja</td> </tr> <tr> <td> </td> <td><input type="checkbox" name="hobi3" value="Bersepeda"> Bersepeda</td> </tr> <tr> <td> </td> <td><input type="checkbox" name="hobi4" value="Naik Gunung"> Naik Gunung </td> </tr> <tr> <td>Pekerjaan</td> <td><select name="pekerjaan"> <option value="0">Pengangguran</option> <option value="1">Wiraswasta</option> <option value="2">Pegawai negeri</option> </select></td> </tr> <tr> <td>Komentar</td> <td><textarea name="komentar" rows="3" cols="35"></textarea></td> </tr> <tr> <td> </td> <td> <input type="submit" name="kirim" value="Kirim"> <input type="reset" name="reset" value="Kosongkan"> </td> </tr> </table> </form> <p> </p> </body> </html> and another file call "formhasil.php" <html> <head> <title>Form Hasil</title> </head> <body> <table width="800" border="0"> <tr> <td width="159">Nama</td> <td width="631"><?php echo "$nama"?></td> </tr> <tr> <td>Password</td> <td> </td> </tr> <tr> <td>Gender</td> <td> </td> </tr> <tr> <td>Hobby</td> <td> </td> </tr> <tr> <td>Pekerjaan</td> <td> </td> </tr> <tr> <td>Komentar</td> <td> </td> </tr> </table> </body> </html> after input data in formisi.php and press submit, I cannot read the variable $nama, it seems empty. whats wrong ? please help me ? Im just learn PHP. |
|
|
|
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 03:18.








Threaded Mode