$_POST[?]-? –
if(isset($_POST[‘kustutaKom’])){
kustutaKom($_POST[‘kustutaKom’]);
header(“Location:”. $_SERVER[‘PHP_SELF’]);
exit();
}
$_REQUEST[?] – The
When a user clicks the submit button, the form data is sent to the PHP file specified in the
$_REQUEST superglobal contains data from submitted forms, URL query strings, and HTTP cookies. (PHP superglobals are built-in variables that are always accessible in all scopes!)
if (isset($_REQUEST[‘presidentNimi’])) {
lisaPresident($_REQUEST[‘presidentNimi’], $_REQUEST[‘pilt’] );
header(“Location: ” . $_SERVER[‘PHP_SELF’]);
exit;
}
action attribute of the <form> tag.
In the PHP file we can use the $_REQUEST variable to collect the value of the input field.Alternate – < … alt= … >HTML attribute specifies an alternate text for an image, if the image cannot be displayed.
ARRAY – Ordered collection of elements in JS or PHP
Aside – Content aside from the page content <aside>
Audio – <audio> HTML element for playing audio files
bind_param – See on meetod, mis seob PHP muutujad asendusmärkidega (?)
// 1. Ettevalmistus (päringu mall koos ?)
$str= $connect->prepare(“INSERT INTO users (name, age) VALUES (?, ?)”);
// 2. Sidumine (bind_param)
// „si“ tähistab andmetüüpe: s = string (string), i = integer (number)
$name = “Alex”; $age = 25;
$str->bind_param(“si”, $name, $age);
// 3. Täitmine
$str->execute();
bind_result – See on meetod, mis seob SQL-päringu tulemuste veerud konkreetsete PHP-muutujatega.
<?php
// 1. Päringu ettevalmistamine ja täitmine
$kask = $yhendus->prepare(“SELECT id, pealkiri FROM lehed”);
// 2. Muutujate sidumine tulemuste veergudega
$kask->bind_result($id, $pealkiri);
$kask->execute();
// 3. Andmete väljavõtmine
while ($kask->fetch()) {
echo “<li><a href='”.$_SERVER[“PHP_SELF”].”?id=$id’>”.
htmlspecialchars($pealkiri).”</a></li>”;
}
?>
Body –
<body> – HTML element, mis sisaldab veebilehe kogu sisu, sealhulgas teksti, pilte, linke ja muid elemente.Button –
Näide:
<button> – HTML element, mis loob nupu, mida saab kasutada erinevate tegevuste, näiteks vormi saatmiseks või interaktiivsete sündmuste (nt JavaScripti käivitamine) jaoks.Näide:
<button type="submit">Saada</button>
