Rabu, 04 Maret 2009

tugas anyar



















scripnya :
<html>
<body background="bg1.jpg">
<br>

<font size="5" ><center>DAFTAR SISWA</center><br />
</font>
<?php
$conn = mysql_connect("localhost","root","");
if (!$conn) {
echo "Could not connect to db";
exit(1);
}
$db = mysql_select_db("latihan",$conn);

$sqlText = "select * from siswa order by induk";
$result = mysql_query($sqlText);
echo "<table border=1 align=center >";
echo "<tr><td width=150><b><center>Nama Siswa</center></b></td>
<td width=150><b><center>Nomor Induk</center></b></td></b>
<td width=150><b><center>Kelas</center></b></td></b></tr>";

while($row=mysql_fetch_object($result))
{
echo "<tr><td>$row->nama</td><td align=center>$row->induk</td><td align=center>$row->kelas</td></tr>";
}

echo "</table>";
?>
</body>
</html>

edit entry siswa

&gthtml&lt


&gtbody background="bg2.jpg"&lt

&gtfont size=16&ltEntry Data Siswa&gt/font&lt
&gtbr /&lt
&gthr&lt
Ketik data-data siswa dibawah ini :&gtbr /&lt
&gtbr /&lt
&gtbr /&lt
&gtform id="form1? name="form1? method="post" action="isisiswa.php"&lt
&gttable&lt
&gttr&lt&gttd&ltNama Siswa&gt/td&lt&gttd&lt&gtinput type="text" name="nama" id="nama" /&lt&gt/td&lt&gt/tr&lt

&gttr&lt&gttd&ltNomor Induk&gt/td&lt&gttd&lt&gtinput type="text" name="induk" id="induk" /&lt&gt/td&lt&gt/tr&lt

&gttr&lt&gttd&ltKelas&gt/td&lt&gttd&lt&gtinput type="text" name="kelas" id="kelas" /&lt&gt/td&lt&gt/tr&lt

&gt/table&lt
&gtbr /&lt
&gtbr /&lt

&gthr&lt
&gtinput type="submit" name="Submit" id="Submit" value="Kirim" /&lt
&gt/form&lt
&gt/body&lt

&gt/html&lt