0% found this document useful (0 votes)
36 views

Fasa 3

The document discusses various PHP coding concepts including: 1) A signup form that takes user input and inserts it into a database table using a SQL insert statement. It then redirects to the login page. 2) References a login page. 3) Mentions importing or uploading data. 4) References a pop-up. 5) Discussing deleting and updating data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Fasa 3

The document discusses various PHP coding concepts including: 1) A signup form that takes user input and inserts it into a database table using a SQL insert statement. It then redirects to the login page. 2) References a login page. 3) Mentions importing or uploading data. 4) References a pop-up. 5) Discussing deleting and updating data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

3.

2 BORANG
3.3 QUERY
3.4 LAPORAN
3.5 MENGEKOD

1) SIGN UP

<?php

include('sambungan.php');

if(isset($_POST['idpelajar'])) {

$idpelajar = $_POST["idpelajar"];

$namapelajar = $_POST["namapelajar"];

$idkelas = $_POST["idkelas"];

$password = $_POST["password"];

$sql = "insert into pelajar values('$idpelajar', '$namapelajar', '$idkelas', '$password')";

$result = mysqli_query($sambungan, $sql);

if ($result)

echo "<script>alert('Berjaya signup')</script>";

else

echo "<script>alert('Tidak berjaya signup')</script>";

echo "<script>window.location='login.php'</script>";

}
?>

<link rel="stylesheet" href="borang.css">

<link rel="stylesheet" href="button.css">

<body background=''>

<center>

<img src='tajuk1.png'><br>

<img src='tajuk2.png'>

</center>

<h3 class="panjang">SIGN UP</h3>

<form class="panjang" action="signup.php" method="post">

<table>

<tr>

<td>ID Pelajar</td>

<td><input type="text" name="idpelajar" placeholder="P001 max 4 char"></td>

</tr>

<tr>

<td>Nama</td>

<td><input type="text" name="namapelajar"></td>

</tr>

<tr>

<td>Kelas</td>

<td>

<select name="idkelas">

<?php

$sql = "select * from kelas";

$data = mysqli_query($sambungan, $sql);

while ($kelas = mysqli_fetch_array($data)) {

echo "<option value='$kelas[idkelas]'>$kelas[namakelas]</option>";

?>

</select>

</td>
</tr>

<tr>

<td>Password</td>

<td><input type="password" name="password" placeholder="max: 8 char"></td>

</tr>

</table>

<button class="tambah" type="submit">Daftar</button>

<button class="padam" type="button" onclick="window.location='login.php'">Batal</button>

</form>

</body>
2) LOG MASUK

-CODING HTML DAN PHP-


3) MUAT NAIK (IMPORT)
4) POP-UP
5 a) PADAM
(padam data)
5 b) KEMASKINI (UPDATE)

You might also like