SCRIPT FORM
<!DOCTYPE html>
<html>
<head> <title> x </title></head>
<body>
<form action="inputformulir.php" method="POST">
<table>
<tr>
<td> NAMA </td>
<td><input type="text" name="nama" value="nama"></td>
</tr>
<tr>
<td> NIM </td>
<td><input type="text" name="nim" value="nama"></td>
</tr>
<tr>
<td> KELAS </td>
<td><input type="text" name="kelas" value="nama"></td>
</tr>
<tr>
<td> FAKTULTAS </td>
<td><input type="text" name="fakultas" value="nama"></td>
</tr>
<tr>
<td> NO HP </td>
<td><input type="text" name="nohp" value="nama"></td>
</tr>
<tr>
<td> <input type="submit" value="kirim"> </td>
<td> <input type="reset" value="reset"></td>
</tr>
</table>
</form>
</body>
</html>
<html>
<head> <title> x </title></head>
<body>
<form action="inputformulir.php" method="POST">
<table>
<tr>
<td> NAMA </td>
<td><input type="text" name="nama" value="nama"></td>
</tr>
<tr>
<td> NIM </td>
<td><input type="text" name="nim" value="nama"></td>
</tr>
<tr>
<td> KELAS </td>
<td><input type="text" name="kelas" value="nama"></td>
</tr>
<tr>
<td> FAKTULTAS </td>
<td><input type="text" name="fakultas" value="nama"></td>
</tr>
<tr>
<td> NO HP </td>
<td><input type="text" name="nohp" value="nama"></td>
</tr>
<tr>
<td> <input type="submit" value="kirim"> </td>
<td> <input type="reset" value="reset"></td>
</tr>
</table>
</form>
</body>
</html>
<?php
$host = "localhost";
$user = "root";
$pass = "";
$db = "webivan";
$conect = mysql_connect($host, $user, $pass) or die ('koneksi gagal');
mysql_select_db($db);
?>
$host = "localhost";
$user = "root";
$pass = "";
$db = "webivan";
$conect = mysql_connect($host, $user, $pass) or die ('koneksi gagal');
mysql_select_db($db);
?>
<?php
include "koneksi.php";
$nama=$_POST['nama'];
$nim=$_POST['nim'];
$kelas=$_POST['kelas'];
$fakultas=$_POST['fakultas'];
$nohp=$_POST['nohp'];
$kirim="Insert INTO formulir_pendaftaran(nama, nim, kelas, fakultas, nohp) value ('$nama','$nim','$kelas','$fakultas','$nohp')";
mysql_query($kirim);
echo "<script> alert (' Data Telah Dikirim')</script>";
echo" <meta http-equiv='refresh' content='0;url=formulir.php' />";
?>
include "koneksi.php";
$nama=$_POST['nama'];
$nim=$_POST['nim'];
$kelas=$_POST['kelas'];
$fakultas=$_POST['fakultas'];
$nohp=$_POST['nohp'];
$kirim="Insert INTO formulir_pendaftaran(nama, nim, kelas, fakultas, nohp) value ('$nama','$nim','$kelas','$fakultas','$nohp')";
mysql_query($kirim);
echo "<script> alert (' Data Telah Dikirim')</script>";
echo" <meta http-equiv='refresh' content='0;url=formulir.php' />";
?>
Posted in: Kuliah
0 komentar:
Posting Komentar