Perintah Kawalan Pergerakan (PKP) hari ke-117

Category: Lesson Web

JavaScript Lesson: Basic

JavaScript adalah programming HTML dan web. JavaScript menghasilkan arahan kepada komputer.

JavaScript boleh dimasukkan di <body> dan <head> di dalam HTML. JavaScript dimasukkan di dalam <script>.

<p id="demo1"></p>
<script>
document.getElementById("demo1").innerHTML = "My First JavaScript";
</script>

Read More

PHP Lesson: MySQL

 MySQL adalah sistem database yang digunakan dengan PHP.

Create Database.

<?php
 $servername = "localhost";
 $username = "username";
 $password = "password";
 $conn = new mysqli($servername, $username, $password);

 if ($conn->connect_error)
 {
 die("Connection failed: " . $conn->connect_error);
 } 
 else
 {
 $sql = "CREATE DATABASE myDB";
 if ($conn->query($sql) === TRUE)
 {
 echo "Database created successfully";
 }
 else
 {
 echo "Error: " . $sql . "<br>" . $conn->error;
 } 
 }
 $conn->close();
?>

Read More

CSS Lesson: Basic

CSS adalah singkatan bagi Cascading Style Sheets. CSS bertujuan menentukan web style, bukan pada kandungan.

<!DOCTYPE html>
<html>
<head>
 <style>
 body {
 background-color: #d0e4fe;
 }
 /* This is a single-line comment */
 h1 {
 color: orange;
 text-align: center;
 }

 p {
 font-family: "Times New Roman";
 font-size: 20px;
 }
 </style>
</head>

<body>
 <h1>CSS Example</h1>
 <p>This is a paragraph.</p>
</body>
</html>

Read More