CS521 Final Term Current Subjective by MS Team
- Type
- Final term past paper
- Course
- CS521 Web Systems and Technologies
- Size
- PDF 768 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 20. Download the file for all 20 pages.
CS521 - Short Questions & Answers
1. Update SQL Query
UPDATE Categories SET CategoryName = ' Web' WHERE CategoryName = ' Business';
- Reference: Week 11, Topic 91
2. PHP Methods for:
o Removing session variable:
session_unset(); // removes all session variables
o Destroying session:
session_destroy(); // ends the session
- Reference: Week 13, Topic 114
3. Using $_FILES in PHP
PHP uses the $_FILES array to handle file uploads. Key steps:
o HTML form should use: enctype="multipart/form-data" o Use $_FILES['fileInputName']['name'], ['type'], ['tmp_name'], ['error'], ['size'] for file details o Example:
if ($_FILES['myFile']['error'] == UPLOAD_ERR_OK) {
move_uploaded_file($_FILES['myFile']['tmp_name' ], 'uploads/' . $_FILES['myFile']['name']);
4. Benefits of AJAX
o Asynchronous communication with server o Reduces page reloads o Improves user experience o Allows partial page updates
5. What are sockets and how they differ from traditional HTML communication
o Socket: Enables full-duplex communication between browser and server.
o Difference:
Traditional HTTP: request-response model Web Sockets: real-time, bi-directional communication
6. Different Types of Form Validation
o Client-side (JavaScript):
Input format, required fields, data type checks
o Server-side (PHP):
Required info, correct data type, range check, regex
o Using PHP filters
filter_var($email, FILTER_VALIDATE_EMAIL);
- Reference: Week 12, Topics 107–108
1. Benefits of using Transactions (with Example)
o Benefits: Ensures data integrity Allows rollback if an error occurs Multiple queries act as one atomic operation o Example:
$pdo->beginTransaction(); $pdo->query("INSERT INTO Categories (CategoryName) VALUES (' Philosophy')"); $pdo->query("INSERT INTO Categories (CategoryName) VALUES (' Art')"); $pdo->commit();
If error occurs, use $pdo->rollback();
2. Syntax to Define Array in PHP + Types of Arrays
o Indexed Array:
$colors = array(" Red", " Green", " Blue");
o Associative Array:
$ages = array(" Peter"=>35, " John"=>40);
o Multidimensional Array:
$students = array( array(" Ali", 20), array(" Sara", 22)
- Reference: Week 9, Topic 78
Related CS521 files
All CS521 files →- CS521 Final Term Quiz by Virtual University Alerts Final term PDF 2.4 MB
- CS521 Final Term Quiz 3 by Wasi Final term PDF 520 KB
- CS521 Final Term Notes Final term PDF 2.5 MB
- CS521 Final Term Notes Set 2 Final term PDF 774 KB
- CS521 Highlighted Slides by Alishba Highlighted PDF 8.3 MB
- CS521 Quiz Explanation Quiz PDF 159 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.