ketik koding berikut ini
<?
mysql_connect("localhost","root","") or die("Database tidak tersambung");
mysql_select_db("mahasiswa") or die("Database tidak ditemukan");
?>
simpan dengan nama koneksi.php
ketik koding berikut ini
<html>
<head>
<title> Pemrograman Web </title>
</head>
<body background="IMAGE/arys.jpg">
<table width="1022" height="514" border="1px" align="center" bgcolor="#FFFF00" >
<tr height="160px">
<td height="19" colspan="2" bgcolor="#00FF00"><div align="center">
<p>SELAMAT DATANG DI WEB RESMI SAYA </p>
<p>WELCOME TO MY BLOG </p>
</div></td>
</tr>
<tr height="10px">
<td height="20" colspan="2" bgcolor="#00FF00"><div align="center"><strong><marquee behavior="alternate">
.:: SELAMAT DATANG DI WEB RESMI SAYA APERIUS GIAWA KELAS TI-M1319 NPM 13110160 STMIK BUDIDARMA ::.
</marquee> </strong></td>
</tr>
<tr height="300px">
<td width="197" height="418" valign="top" bgcolor="#00FF00" >
<table border="1px" width="100%" >
<tr> <td bgcolor="#00FF00"> <a href="index.php?hal=mahasiswa.php&k=halaman_daftar"> Mahasiswa </a> </td> </tr>
<tr> <td bgcolor="#00FF00">menu3</td> </tr>
<tr> <td bgcolor="#00FF00">menu4</td> </tr>
<tr> <td bgcolor="#00FF00">menu5</td> </tr>
</table> </td>
<td width="809" valign="top" bgcolor="#00FF00">
<?
$halaman=$_REQUEST[hal];
if(isset($halaman)){
include "$halaman";
}else{
include "mahasiswa.php";
}
?> </td>
</tr>
</table>
</body>
</html>
simpan dengan nama index.php
ketik koding berikut ini
<?
function head($action,$judul){
echo"<form name='mhs' action='$action' method='POST'>
<table border='1px' width='500px'>
<tr><th colspan='3'>.:: $judul ::.</th></tr>";
}
function textbox($label,$name,$size,$value){
echo"<tr><td>$label</td><td>:</td>
<td><input type='text' value='$value' name='$name' size='$size' maxlength='$size' /></td>
</tr>";
}
function textarea($label,$name,$cols,$rows,$value){
echo"<tr><td>$label</td><td>:</td>
<td><textarea name='$name' cols='$cols' rows='$rows'> $value </textarea></td>
</tr>";
}
function combobox($label,$name,$pilihan,$value){
echo"<tr><td>$label</td><td>:</td>
<td><select name='$name' id='$name'>";
$plh=explode(",",$pilihan);
for ($i=0; $i<count($plh); $i++){
if ($value==$plh[$i]){
echo"<option value='$plh[$i]' selected>$plh[$i]</option>";
}else{
echo"<option value='$plh[$i]'>$plh[$i]</option>";
}
}
echo"</select></td></tr>";
}
function tombol($value){
echo"<tr><td ><input type='submit' name='submit' value='$value' /></td>
<td> </td>
<td><input type='reset' name='submit2' value='batal' /></td>
</tr>
</table>
</form>";
}
?>
simpan dengan nama function.php
Tidak ada komentar:
Posting Komentar