© 2026 schoolict.net (Ruwan Mangala Suraweera)
10.7 Dynamic Web Pages with PHP and MySQLPHP සහ MySQL සමඟ ගතික වෙබ් පිටු
Grade 13 A/L ICT · Lesson 1013 ශ්රේණිය A/L ICT · පාඩම 10
In this videoමේ වීඩියෝවේ
- Dynamic pages are built on the server.ගතික පිටු සේවාදායකයේ සාදයි.
- PHP sits in and echoes HTML.PHP තුළ HTML echo කරයි.
- Variables, arrays, control structures, functions.විචල්ය, අරා, පාලනය, ශ්රිත.
- Forms send data by GET or POST.පෝරම GET හෝ POST.
- PHP saves and retrieves MySQL data.PHP MySQL දත්ත සුරකියි/ලබා ගනී.
Notesසටහන්
Syllabus 10.7. A static page shows the same HTML to everyone; a dynamic page is built by the server each time, often from a database. PHP code is embedded in HTML between , runs on the web server and sends only HTML to the browser. You use variables, arrays, control structures and functions, collect input with forms and save or retrieve data in a MySQL database.විෂය නිර්දේශය 10.7. ස්ථිතික පිටුවක් සැමට එකම HTML පෙන්වයි; ගතික පිටුවක් සෑම වරම සේවාදායකය මගින්, බොහෝ විට දත්ත සමුදායකින් ගොඩනගයි. PHP කේතය අතර HTML තුළ කාවද්දා, වෙබ් සේවාදායකයේ ධාවනය වී බ්රව්සරයට HTML පමණක් යවයි. විචල්ය, අරා, පාලන ව්යුහ සහ ශ්රිත භාවිත කර, පෝරම මගින් ආදානය ලබා MySQL දත්ත සමුදායක සුරකියි හෝ ලබා ගනී.
1. How PHP works1. PHP ක්රියා කරන ආකාරය
2. PHP basics2. PHP මූලික
>>
= 75) {
return "A";
} elseif ($mark >= 50) {
return "C";
} else {
return "F";
}
}
echo ">" . $school . "
>";
echo ">Total: $total, Average: " . round($avg, 1) . "
>";
for ($i = 0; $i < count($marks); $i++) {
echo ">" . $marks[$i] . " = " . grade($marks[$i]) . "
>";
}
$student = array("name" => "Nimal", "stream" => "Tech"); // associative array
echo ">" . $student["name"] . " (" . $student["stream"] . ")
>";
?>
>>▶ HTML sent to the browserබ්රව්සරයට යවන HTML
Green Valley
Total: 211, Average: 70.3
78 = A
45 = F
88 = A
Nimal (Tech)
▶ What the browser showsබ්රව්සරය පෙන්වන දේ
3. Forms3. පෝරම
>
>
>Register >
>
>
>
>
>▶ Result in the browserබ්රව්සරයේ ප්රතිඵලය
