-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform_mhs_validasi_php.php
48 lines (47 loc) · 1.18 KB
/
form_mhs_validasi_php.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<title>Form Mahasiswa</title>
</head>
<body>
<form name="myform" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<table>
<caption>Form Mahasiswa</caption>
<tr>
<td>NIM</td><td>:</td><td><input type="text" name="vnim" size="20" /></td>
</tr>
<tr>
<td>Nama</td><td>:</td><td><input type="text" name="vnama" size="20" /></td>
</tr>
<tr>
<td>Alamat</td><td>:</td><td><textarea rows="3" cols="40" name="valamat"></textarea></td>
</tr>
<tr>
<td colspan="3"><input type="submit" value="Proses" /><input type="button" value="Cancel" /></td>
</tr>
</table>
</form>
</body>
<?php
if (isset ($_POST["vnim"]))
{
$xnim=$_POST["vnim"];
if (strlen($xnim)==0)
{
echo "NIM tidak boleh kosong";
}
else
{
echo "Proses Lanjut";
if (isset ($_POST["vnama"]))
{
$xnama=$_POST["vnama"];
}
if (isset ($_POST["valamat"]))
{
$xalamat=$_POST["valamat"];
}
}
}
?>
</html>