webtech / revision-notes
Unit I

HTML · CSS · XML · XHTML · DOM

Web foundations — structure, styling, markup rules, and document models

HTML5CSS Box Model PositioningXML/DTD/Schema XHTMLDOMSAX
01 HTML — HyperText Markup Language
HTML = skeleton of a webpage. Tells the browser what to show and how to structure it. Tags come in pairs; closing tag has /. Self-closing: <br> <img> <hr>
Standard Document Structure
<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <!-- content here -->
  </body>
</html>
⚠ DOCTYPE

<!DOCTYPE html> tells browser it's HTML5 — always the FIRST line!

head vs body

<head> = metadata (invisible). <body> = actual visible content.

TagPurposeOutput
<h1>–<h6>HeadingsLargest → Smallest
<p>ParagraphBlock of text
<strong> / <b>BoldBold text
<em> / <i>ItalicItalic text
<mark>HighlightHighlighted
<br>Line break(self-closing)
<a href="...">HyperlinkClickable link
<img src="..." alt="...">ImageDisplays image
AttributeMeaning
idUnique ID for element
classGroup style (CSS)
srcFile path / URL
hrefLink URL
altAlt text for images (accessibility + fallback)
titleTooltip on hover
02 HTML5 Semantic Elements & Layout
HTML5 Semantic Page Layout
<header> — Top of page
<nav> — Navigation menu
<section>
<article>
<main>
<aside>
Sidebar
<footer> — Bottom of page
Link Types
Typehref value
Externalhttps://google.com
Internalpage2.html
Anchor#section1
Emailmailto:x@y.com
Form Inputs
TypeUse
textSingle line
emailEmail only
passwordHidden text
radioOne choice
checkboxMulti choice
fileUpload
Exam Tip: Semantic elements (header, nav, main, section, article, aside, footer) improve SEO and accessibility. They're HTML5 additions — always distinguish from div/span which are non-semantic.
03 CSS — Cascading Style Sheets
CSS = interior designer for HTML. Controls colors, fonts, layout, animations, responsive design.
CSS Rule Structure
h1
Selector
{ color : blue ; }
Property : Value
1. Inline CSS

<p style="color:red">

2. Internal CSS

<style> inside <head>

3. External CSS ✓

<link rel="stylesheet" href="style.css"> — Best practice!

SelectorSyntaxTargets
Elementp { }All <p> tags
Class.box { }class="box"
ID#header { }id="header"
Universal* { }Everything
Descendantdiv p { }<p> inside <div>
Childdiv > p { }Direct child only
Pseudo-classa:hover { }On hover
Pseudo-elementp::first-line { }First line only
CSS PropertyOptions / Example
colorred, #ff0000, rgb(255,0,0)
text-alignleft | center | right | justify
text-decorationunderline | overline | line-through
text-transformuppercase | lowercase | capitalize
font-familyArial, sans-serif
font-size24px | 1.5em | 1.5rem
font-weightnormal | bold | 100–900
CSS Specificity (High → Low)
!important (override)
Inline (1000)
ID (100)
.class (10)
tag (1)
04 CSS Box Model
Every HTML element is a box with 4 layers: Content → Padding → Border → Margin
MARGIN (space outside)
PADDING (space inside)
BORDER
CONTENT
Total width = margin + border + padding + content + padding + border + margin
Margin ShorthandMeaning
margin: 10pxAll 4 sides = 10px
margin: 10px 20pxTop/Bottom | Left/Right
margin: 10px 20px 15pxTop | L/R | Bottom
margin: 10px 20px 15px 25pxTop Right Bottom Left (clockwise)
💡
box-sizing: border-box — width includes padding + border. Always use this! Default (content-box) only counts content.
05 CSS Positioning
PositionBehavior
staticDefault, normal document flow
relativeOffset from its own normal position
absoluteRemoved from flow, placed relative to nearest positioned parent
fixedAlways stays on screen (relative to viewport)
stickyRelative until scroll threshold, then fixed
CSS UnitsTypeNotes
pxAbsoluteFixed pixels
%RelativeRelative to parent
emRelativeRelative to parent font-size
remRelativeRelative to root (html) font-size
vw/vhRelativeViewport width / height
06 XML — eXtensible Markup Language
HTML
  • Displays data
  • Predefined tags
  • Case-insensitive
  • Forgiving syntax
  • XML
  • Describes / stores data
  • Custom-made tags
  • Case-sensitive
  • All tags must be closed
  • <?xml version="1.0" encoding="UTF-8"?>
    <bookstore>
      <book id="1">
        <title>Learning XML</title>
        <author>John Doe</author>
        <price>29.99</price>
      </book>
    </bookstore>
    DTD — Document Type Definition

    Defines structure and rules for an XML document — a blueprint of allowed elements.


    Internal: small, single doc

    External: reuse across many docs

    XML Schema (XSD)

    More powerful than DTD. Supports data types, better validation, namespace support.


    FeatureDTDXSD
    Data typesNoYes
    NamespaceLimitedFull
    LearningEasyModerate
    07 XHTML — eXtensible HTML
    XHTML = HTML written with XML rules. Stricter than HTML.
    HTML
  • <P>Paragraph
  • <BR> OK
  • Uppercase tags OK
  • No quote needed
  • Forgiving syntax
  • XHTML
  • <p>Paragraph</p>
  • <br /> (self-close)
  • lowercase ONLY
  • Quotes required
  • Strict XML rules
  • Character EntityCodeDescription
    <&lt;Less than
    >&gt;Greater than
    &&amp;Ampersand
    (space)&nbsp;Non-breaking space
    ©&copy;Copyright
    08 DOM — Document Object Model
    DOM = tree-structure representation of an XML/HTML document in memory. Programs can access & modify it.
    Document
    Root Element
    Element
    Element
    Text
    Attribute
    Text Content
    DOM Tree — Hierarchical Structure
    DOM Parser
  • Loads entire doc into memory
  • Tree structure
  • Random access ✓
  • Small docs only
  • SAX Parser
  • Reads sequentially
  • Event-driven
  • Memory efficient ✓
  • Large docs only
  • Rule: DOM = small files needing modification. SAX = large files, read-only.
    Unit II

    JavaScript & JSP

    Client-side scripting with JS + Server-side Java Server Pages

    JS SyntaxDOM Manipulation Arrays/FunctionsJSP Lifecycle DirectivesImplicit ObjectsJDBC
    01 Introduction to JavaScript
    JavaScript (JS) = lightweight, interpreted programming language that runs in web browsers to make pages interactive and dynamic. Created in 10 days by Brendan Eich (1995).
    JavaScript — Behaviour / Interactivity
    CSS — Presentation / Styling
    HTML — Structure / Skeleton
    Inclusion MethodSyntax
    Inline<button onclick="fn()">
    Internal<script>...</script> in head/body
    External ✓<script src="app.js"></script>
    💡
    Place <script> at bottom of <body> so HTML loads first, or use defer attribute.
    02 Syntax, Variables & Data Types
    let name = "John";      // String
    let age = 25;          // Number
    let isStudent = true;  // Boolean
    let x;                 // undefined
    const PI = 3.14;       // constant
    // Template literal
    let msg = `Hello, ${name}!`;
    TypeExampleNotes
    Numberlet x = 25; 9.99Integers & decimals
    String"hello" 'world'Text in quotes
    Booleantrue / falseLogic values
    Undefinedlet x;Declared, no value
    Nulllet x = null;Intentionally empty
    Object{ name: "John" }Key-value pairs
    Array[1, 2, 3]Ordered list
    == vs ===== does type coercion (loose). === strict equality. Always prefer === in exams!
    typeof null returns "object" — JS quirk!
    03 Control Statements & Loops
    if (marks >= 90) {
      console.log("Grade A");
    } else if (marks >= 75) {
      console.log("Grade B"); // runs
    } else {
      console.log("Grade C");
    }
    switch(day) {
      case "Monday":
        console.log("Start");
        break; // MANDATORY!
      case "Friday":
        console.log("TGIF");
        break;
      default:
        console.log("Regular");
    }
    LoopUse WhenSyntax
    forKnown countfor(init; cond; step)
    whileUnknown countwhile(cond){}
    do-whileAt least oncedo{}while(cond)
    for...inObject keysfor(k in obj)
    for...ofIterable valuesfor(v of arr)
    04 Arrays & Functions
    Array MethodActionReturns
    push(x)Add to endNew length
    pop()Remove from endRemoved elem
    shift()Remove from startRemoved elem
    unshift(x)Add to startNew length
    indexOf(x)Find indexIndex or -1
    slice(s,e)Extract portionNew array
    splice(i,n)Remove/insertRemoved items
    join(sep)Array → stringString
    Function Declaration (Hoisted)
    function greetUser(name) {
      return "Hello, " + name;
    }
    Arrow Function (ES6)
    const multiply = (a, b) => a * b;
    const square = x => x * x;
    💡
    Hoisting Rule: Function declarations are hoisted (can call before definition). Function expressions and arrow functions are NOT hoisted.
    05 DOM & Browser Environment
    DOM (Document Object Model) = tree representation of HTML that JS can read & modify.
    document
    <html>
    <head>
    <body>
    <title>
    <div>
    <p>
    <button>
    // Selecting elements
    document.getElementById("myBtn");        // by id
    document.getElementsByTagName("p");      // by tag
    document.querySelector(".class");       // first match
    document.querySelectorAll("div.box");   // all matches
    
    // Manipulation
    element.innerHTML = "New content";
    element.style.color = "red";
    
    // Events
    button.addEventListener("click", () => {
      alert("Clicked!");
    });
    06 Form Validation
    document.getElementById("myForm")
      .addEventListener("submit", function(event) {
        event.preventDefault(); // stop default submit
        let name = document.getElementById("name").value;
        if (name.length < 2) {
          alert("Name must be ≥ 2 chars");
          return;
        }
        alert("Form valid! Submitting...");
      });
    FieldRegex Pattern
    Email/^[\s@]+@[^\s@]+\.[^\s@]+$/
    Phone (10 digit)/^[0-9]{10}$/
    Required fieldvalue.trim() !== ""
    07 JSP — Java Server Pages
    JSP = server-side technology to create dynamic HTML using Java embedded in .jsp files.
    CLIENT (Browser)
  • HTML + CSS + JavaScript
  • Runs in browser
  • No server needed
  • SERVER (JSP)
  • JSP + Java + DB
  • Runs on server
  • Generates HTML response
  • JSP Tag Summary
    <% ... %>
    Scriptlet — Java logic
    <%= ... %>
    Expression — output value (no semicolon!)
    <%! ... %>
    Declaration — class-level
    <%@ ... %>
    Directive — page settings
    DirectiveSyntaxPurpose
    page<%@ page ... %>Page-level settings
    include<%@ include file="x.jsp" %>Static include (compile time)
    taglib<%@ taglib uri="..." prefix="c" %>Custom tag libs (JSTL)
    08 JSP Processing & Lifecycle
    1
    TranslationJSP → Servlet (1st request only)
    2
    CompilationServlet → Bytecode (1st request only)
    3
    Loading & InstantiationJVM loads the servlet class
    4
    jspInit()Initialization — called ONCE only
    5
    jspService()Called on EVERY request — handles req/res
    6
    jspDestroy()Shutdown — called once before removal
    Key Fact: Translation & compilation happen only once (first request). Subsequent requests go directly to jspService() — making JSP fast after warm-up.
    FeatureJSPServlet
    File type.jsp.java
    FocusPresentation (HTML)Logic/Controller
    HTMLEasy inline HTMLout.println() needed
    Behind scenesConverted to Servlet!Already a Servlet
    09 JSP Implicit Objects
    Pre-built objects available in every JSP page — no need to declare them.
    request
    response
    session
    application
    out
    page
    pageContext
    config
    exception*
    ObjectTypeCommon Methods
    requestHttpServletRequestgetParameter(), getMethod()
    responseHttpServletResponsesetContentType(), sendRedirect()
    sessionHttpSessionsetAttribute(), getAttribute(), invalidate()
    applicationServletContextsetAttribute(), getAttribute()
    outJspWriterprint(), println()
    10 JavaBeans & DB in JSP
    JavaBean = reusable Java class following strict conventions: ① No-arg constructor ② Private properties ③ Getter/Setter methods
    public class Student implements java.io.Serializable {
      private String name;
      private int age;
      public Student() {} // no-arg constructor required
      public String getName() { return name; }
      public void setName(String n) { name = n; }
    }
    Bean ScopeAvailabilityUse Case
    pageCurrent page onlyTemp calculations
    requestCurrent requestForm data passing
    sessionUser's sessionLogin info, cart
    applicationAll users, all pagesSite-wide config
    JSP DB Connection (JDBC) — 5 Steps
    1. Import
    2. Load Driver
    3. Connect
    4. Execute
    5. Close all
    Unit III

    PHP & Server-Side Development

    Server-side scripting, forms, file I/O, cookies, sessions

    PHP SyntaxArraysFunctions String FunctionsForm Processing File I/OCookiesSessions
    01 PHP Introduction & Server-Side Dev
    PHP (Hypertext Preprocessor) = server-side scripting language. Runs on server, generates HTML sent to browser. User never sees PHP code, only output HTML.
    Browser (User)
    → HTTP Req →
    PHP Web Server
    runs script
    → SQL query →
    MySQL (DB)
    ← data ← HTML resp ←
    Client-Side
  • Browser handles HTML, CSS, JS
  • Runs on user's machine
  • Visible to user
  • Server-Side (PHP)
  • PHP/Python runs on server
  • Hidden from user
  • Accesses databases & files
  • 02 Basic Syntax & Variables
    <?php
    $name      = "John";   // String
    $age       = 25;       // Integer
    $height    = 5.8;      // Float
    $isStudent = true;    // Boolean
    
    // Concatenation uses dot (.)
    echo "Name: " . $name;
    
    // if-elseif-else
    if ($score >= 90) {
      echo "Grade: A";
    } elseif ($score >= 80) {
      echo "Grade: B";
    } else {
      echo "Grade: F";
    }
    ?>
    PHP is loosely typed — no need to declare type. $x = 5; is int, $x = "5"; is string. Use gettype($var) to check.
    03 Loops & Functions
    // for loop
    for ($i=1; $i<=5; $i++) {
      echo $i . "<br>";
    }
    
    // foreach (arrays)
    $fruits = ["Apple","Banana"];
    foreach($fruits as $f) {
      echo $f;
    }
    // function with default param
    function createProfile(
      $name, $age=18,
      $city="Unknown"
    ) {
      return "$name, $age";
    }
    createProfile("Jatin");
    // age=18, city=Unknown
    PHP Array FunctionsWhat it doesExample
    count()Number of elementscount($arr) → 3
    array_push()Add to endarray_push($arr,"x")
    array_pop()Remove lastarray_pop($arr)
    in_array()Check if value existsin_array("x",$arr)
    sort()Sort ascendingsort($arr)
    array_merge()Combine arraysarray_merge($a,$b)
    04 String Functions
    FunctionPurposeExample → Result
    strlen($s)Count chars"Hello" → 5
    strtoupper($s)Uppercase"php" → "PHP"
    strtolower($s)Lowercase"HELLO" → "hello"
    substr($s,0,3)Substring"Hello" → "Hel"
    str_replace($f,$r,$s)Find & replace"World"→"PHP"
    trim($s)Remove whitespace" hi " → "hi"
    explode(",",$s)Split to array"a,b" → ["a","b"]
    implode("-",$a)Join to string["a","b"] → "a-b"
    strpos($s,$n)Find positionreturns int or false
    htmlspecialchars($s)Escape HTMLXSS protection!
    strpos() returns 0 (not false) if found at position 0. Always use !== false, NOT != false.
    🛡
    Always sanitize user input! Use htmlspecialchars() when displaying user data to prevent XSS attacks. Use trim() to remove accidental spaces.
    05 Form Processing — $_POST & $_GET
    GET
  • Data in URL (visible)
  • Bookmarkable
  • Max ~2000 chars
  • Use for search/filter
  • POST
  • Data in body (hidden)
  • More secure
  • No size limit
  • Use for sensitive data
  • <?php
    if ($_POST) {
      $username = $_POST['username'];
      $email    = $_POST['email'];
    
      // Sanitize output
      echo htmlspecialchars($username);
    
      // Validation
      if (empty($username)) {
        echo "Username required";
      }
      if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        echo "Invalid email";
      }
    }
    ?>
    💡
    Browser Redirect: header("Location: page.php"); exit();
    header() must be called BEFORE any HTML output!
    06 File Operations
    // Read entire file
    $content = file_get_contents("data.txt");
    echo $content;
    
    // Check file exists first!
    if (file_exists("data.txt")) {
      echo "File found!";
    }
    // Write (overwrites)
    file_put_contents("out.txt", $data);
    
    // Append to file
    file_put_contents(
      "out.txt", $newData,
      FILE_APPEND
    );
    File Mode (fopen)Meaning
    "r"Read only
    "w"Write (overwrites)
    "a"Append
    "r+"Read + write
    Always fclose($file) when done — prevents memory leaks!
    07 Cookies & Sessions
    Cookies
  • Stored in browser
  • Persist across browser restarts
  • Strings only
  • User can delete them
  • ~4KB per cookie
  • Less secure (visible)
  • setcookie() / $_COOKIE
  • Sessions
  • Stored on server
  • Lost when browser closes (default)
  • Any type (objects too)
  • More secure
  • No practical limit
  • More secure
  • session_start() / $_SESSION
  • // Set cookie (1 hour)
    setcookie("username", "Jatin", time()+3600);
    
    // Read cookie
    if (isset($_COOKIE["username"])) {
      echo $_COOKIE["username"];
    }
    
    // Delete cookie
    setcookie("username", "", time()-3600);
    <?php
    session_start(); // MUST be first!
    $_SESSION["username"] = "Jatin";
    $_SESSION["age"]      = 20;
    echo $_SESSION["username"];
    
    // Destroy session (logout)
    session_destroy();
    ?>
    setcookie() and session_start() must be called BEFORE any HTML output! Same rule as header().
    Unit IV

    PHP & MySQL — Database Integration

    CRUD operations, SQL queries, state management, error handling

    mysqli_connect()CRUDDDL/DML/DQL ALTER TABLEState Mgmt DB ErrorsphpMyAdmin
    01 Connecting PHP with MySQL
    PHP = Hypertext Preprocessor (server-side scripting). MySQL = Relational Database Management System (RDBMS) — stores data in tables.
    <?php
    $conn = mysqli_connect("localhost","root","","college");
    if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
    }
    echo "Connected successfully";
    // ... do work ...
    mysqli_close($conn); // ALWAYS close!
    ?>
    1
    Connect — mysqli_connect()Links PHP to MySQL server
    2
    Check — if(!$conn)Verifies link succeeded
    3
    die() on failureStops script + shows error
    4
    Query/OperateRun SQL via mysqli_query()
    5
    Close — mysqli_close($conn)Always close when done
    ParameterValue (example)Meaning
    host"localhost"Server address
    username"root"DB username
    password""DB password
    database"college"Target DB name
    Create Database
    $sql = "CREATE DATABASE college";
    if (mysqli_query($conn, $sql)) {
      echo "DB created!";
    }
    💡
    When creating a DB, do NOT pass database name to mysqli_connect() — connect to server only.
    Select Database
    mysqli_select_db($conn, "college");
    // OR pass db name in connect()
    mysqli_connect("h","u","p","college");
    After select_db, all subsequent queries run inside that database automatically.
    02 CRUD Operations
    // A) SELECT — Fetch Data
    $sql = "SELECT * FROM students";
    $result = mysqli_query($conn, $sql);
    while ($row = mysqli_fetch_assoc($result)) {
      echo $row["name"] . " - " . $row["age"];
    }
    
    // B) INSERT — Add Data
    $sql = "INSERT INTO students (name,age) VALUES ('Amit',21)";
    mysqli_query($conn, $sql);
    
    // C) UPDATE — Modify Data
    $sql = "UPDATE students SET age=22 WHERE name='Amit'";
    mysqli_query($conn, $sql);
    
    // D) DELETE — Remove Data
    $sql = "DELETE FROM students WHERE name='Amit'";
    mysqli_query($conn, $sql);
    WHERE clause: Always use WHERE in UPDATE & DELETE — otherwise ALL rows affected!
    FunctionDescription
    mysqli_connect()Connect PHP to MySQL server
    mysqli_query()Execute SQL queries
    mysqli_fetch_assoc()Fetch row as associative array ($row["name"])
    mysqli_fetch_array()Fetch row as numeric array ($row[0])
    mysqli_error()Return error message string
    mysqli_close()Close the connection
    mysqli_connect_error()Error on initial connection fail
    mysqli_select_db()Switch to a specific database
    fetch_assoc vs fetch_array
    fetch_assoc()
  • $row["Database"]
  • Associative array
  • Access by column name
  • fetch_array()
  • $row[0]
  • Numeric array
  • Access by index
  • 03 Types of SQL Queries
    SQL Queries
    DDL
    DML
    DQL
    CREATE ALTER DROP
    INSERT UPDATE DELETE
    SELECT
    TypeFull NamePurposeCommands
    DDLData DefinitionDefine structureCREATE, ALTER, DROP
    DMLData ManipulationModify dataINSERT, UPDATE, DELETE
    DQLData QueryRetrieve dataSELECT
    Exam Tip: SHOW DATABASES → no DB arg needed | SHOW TABLES → need DB selected first.
    04 Altering Tables & Deletion
    ADD
    ADD col TYPE
    MODIFY
    MODIFY col TYPE
    DROP
    DROP col
    -- Add Column
    ALTER TABLE students ADD email VARCHAR(50);
    
    -- Modify Column
    ALTER TABLE students MODIFY age INT(3);
    
    -- Drop Column
    ALTER TABLE students DROP email;
    
    -- Template: ALTER TABLE tbl [ADD|MODIFY|DROP] col_name [TYPE]
    OperationSQL CommandEffect
    Delete DataDELETE FROMRemoves rows only; table stays
    Delete TableDROP TABLERemoves table + ALL data
    Delete DatabaseDROP DATABASERemoves DB + ALL tables + data
    ⚠ DANGER
    DROP operations are irreversible. Always backup before dropping!
    05 Managing State — Cookies & Serialization
    Problem (HTTP Stateless)
  • Request 1 → server forgets
  • Request 2 → still forgets
  • Login, cart = lost!
  • Solutions
  • ① Cookies
  • ② Sessions
  • ③ Hidden form fields
  • ④ URL rewriting (?key=val)
  • Query String (URL Parameters)
    welcome.php?name=Jatin&age=20
    // Access:
    $_GET['name'] // retrieves "Jatin"
    Serialization

    Convert arrays/objects to string for storage. Reverse with unserialize().

    $data = ["name"=>"Jatin"];
    $str = serialize($data);
    $back = unserialize($str);
    echo $back["name"]; // Jatin
    06 Database Bugs & Errors
    Error TypeMessageCauseFix
    ConnectionAccess denied for user 'root'Wrong username/password; MySQL not runningCheck credentials; Start MySQL in XAMPP
    DB Not FoundUnknown database 'college'DB not created / typoRun CREATE DATABASE first
    Table Not FoundTable 'students' doesn't existTable not created / typoCreate table, verify name
    SQL SyntaxYou have an error in your SQL syntaxMissing commas/quotes, wrong keywordCheck syntax carefully
    Duplicate EntryDuplicate entry '1' for key 'PRIMARY'Duplicate PRIMARY KEY valueUse AUTO_INCREMENT
    Undefined IndexUndefined index: usernameAccessing form data without checkingUse isset($_POST['username'])
    Best Practices ✓
    • ✓ Always check connection with if(!$conn)
    • ✓ Use WHERE in UPDATE/DELETE
    • ✓ Use AUTO_INCREMENT for primary keys
    • ✓ Use isset() before accessing $_POST/$_GET
    • ✓ Call session_start() first
    • ✓ Close connections after use
    Common Mistakes ✗
    • ✗ Forget WHERE clause in DELETE (deletes all!)
    • ✗ Pass DB name when creating DB (use 3 args only)
    • ✗ Insert duplicate primary key values
    • ✗ Access $_POST without isset()
    • ✗ Forget quotes around string values in SQL
    07 phpMyAdmin
    phpMyAdmin = web-based graphical tool written in PHP to manage MySQL databases — without writing SQL manually.
    Create/Drop

    Databases & tables via GUI

    Insert/Edit

    Records in a form view

    Run SQL

    Execute queries in SQL tab

    Export/Import

    Backup & restore .sql files

    🌐
    Access: Open browser → localhost/phpmyadmin (requires XAMPP/WAMP running)
    Key Syntax Summary
    Connect : mysqli_connect(host, user, pass, db)
    Create  : CREATE DATABASE name | CREATE TABLE t (...)
    Insert  : INSERT INTO t (col1,col2) VALUES (v1,v2)
    Select  : SELECT * FROM t [WHERE condition]
    Update  : UPDATE t SET col=val WHERE condition
    Delete  : DELETE FROM t WHERE condition
    Drop    : DROP TABLE t | DROP DATABASE db
    Cookie  : setcookie(name, value, expiry)
    Session : session_start(); $_SESSION["key"]="val"