Hello everyone..it's me again..adindra
i have a problem :
i have 1 database name manipulasiphp, with 10 field (id,nama,email,alamat,umur,negara,universitas,jurusan,prodi,no_telp)
i have 1 HTML script and 1 PHP script
they're name are index.html and input.php
here's the script :
index.html
<html>
<head>
<title>Form Calon Peserta Beasiswa Monbugakusho Jepang</title>
</head>
<body>
<form method="post" action="input.php">
<table>
<tr>
<td>Nama</td>
<td>: <input type="text" name="nama"></td>
</tr>
<tr>
<td>Email</td>
<td>: <input type="text" name="email"></td>
</tr>
<tr>
<td>Alamat</td>
<td>: <input type="text" name="alamat"></td>
</tr>
<tr>
<td>Umur</td>
<td>: <input type="text" name="umur" size="2" maxlength="3">tahun</td>
</tr>
<tr>
<td>Negara</td>
<td>: <input type="text" name="negara"></td>
</tr>
<tr>
<td>Universitas</td>
[B]<td>: <select name="universitas[]">
<option value="1">Universitas Gadjah Mada,Yogyakarta</option>
<option value="2">Institut Teknologi Bandung,Bandung</option>
<option value="3">Universitas Indonesia,Jakarta</option>
<option value="4">Institut Teknologi Sepuluh November,Surabaya</option>
<option value="5">Universitas Airlangga,Surabaya</option>
</td>[/B]
</tr>
<tr>
[B]<td>Jurusan :</td>
<td><input type="radio" name="jurusan" value="1">Teknik Fisika
<br><input type="radio" name="jurusan" value="2">Teknik Kimia
<br><input type="radio" name="jurusan" value="3">Teknik Informatika
<br><input type="radio" name="jurusan" value="4">MIPA
</td>[/B]
</tr>
<tr>
<td>Prodi</td>
<td>: <input type="text" name="prodi"></td>
</tr>
<tr>
<td>No Telpon</td>
<td>: <input type="text" name="notelpon"></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Daftar Beasiswa"></td>
<td><input type="reset" name="reset" value="Ndak Jadi ahh.."></td>
</tr>
</table>
</form>
</body>
</html>
then input.php
<?php
$host="localhost";
$usnm="root";
$pswd="";
$koneksi=mysql_connect("$host","$usnm","$pswd") or die ("Localhost tidak terkoneksi");
mysql_select_db("manipulasiphp",$koneksi);
$input_nama=$_POST['nama'];
$input_email=$_POST['email'];
$input_alamat=$_POST['alamat'];
$input_umur=$_POST['umur'];
$input_negara=$_POST['negara'];
$input_univ=$_POST['universitas'];
$input_jurusan=$_POST['jurusan'];
$input_prodi=$_POST['prodi'];
$input_no_telp=$_POST['notelpon'];
if((!empty($input_nama)) && (!empty($input_email)) && (!empty($input_alamat)) && (!empty($input_umur)) && (!empty($input_negara)) && (!empty($input_univ)) && (!empty($input_jurusan)) && (!empty($input_prodi)) && (!empty($input_no_telp)))
{
$query=mysql_query("INSERT INTO member (nama,email,alamat,umur,negara,universitas,jurusan,prodi,no_telp) VALUES ('$input_nama','$input_email','$input_alamat','$input_umur','$input_negara','$input_univ','$input_jurusan','$input_prodi','$input_no_telp')",$koneksi);
echo "Calon Peserta Beasiswa baru telah terdaftar!!";
echo "<br>";
echo "<br>Untuk melihat peserta lainnya, klik <a href=\"view.php\">disini</a>";
}
else
{
echo "<script>alert('Formulir pendaftaran harus diisi dengan lengkap');javascript:history.go(-1);</script>";
}
?>
in universitas html form,the html tag is select to show dropdown list
in jurusan html form,the html tag isradio
the question is :
"How to insert data to MySQL Database,from HTML Form with tag SELECT at Universitas field and tag type RADIO at Jurusan field??"
can you give me the right PHP script in my input.php file?
Hope you can help...