Hands-on projects to practice your new skills
This document contains hands-on projects and exercises designed to help VBScript/Classic ASP developers practice Python and PHP web development. Each project builds on the concepts learned in the training materials.
Each exercise includes:
Objective: Learn basic form handling and validation in Flask
<%
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim name, email, age
name = Request.Form("name")
email = Request.Form("email")
age = Request.Form("age")
' Process form...
End If
%>
Save as personal_info_app.py
:
from flask import Flask, render_template, request, flash, redirect, url_for
app = Flask(__name__)
app.secret_key = 'your-secret-key'
# Store submissions in memory (in real app, use database)
submissions = []
@app.route('/', methods=['GET', 'POST'])
def personal_info():
if request.method == 'POST':
# TODO: Get form data
# TODO: Validate data
# TODO: Store valid data
# TODO: Show success/error messages
pass
return render_template('personal_info.html', submissions=submissions)
if __name__ == '__main__':
app.run(debug=True)
Objective: Learn basic form handling and validation in PHP
Requirements: Same as Exercise 1, but implemented in PHP
Save as personal_info.php
:
<?php
session_start();
// Store submissions in session (in real app, use database)
if (!isset($_SESSION['submissions'])) {
$_SESSION['submissions'] = [];
}
$errors = [];
$success = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// TODO: Get form data
// TODO: Validate data
// TODO: Store valid data
// TODO: Set success/error messages
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Personal Information Form</title>
<!-- Add CSS styling -->
</head>
<body>
<h1>Personal Information Form</h1>
<!-- TODO: Display success/error messages -->
<form method="POST">
<!-- TODO: Add form fields -->
<input type="submit" value="Submit">
</form>
<!-- TODO: Display submissions table -->
</body>
</html>
Objective: Learn CRUD operations, sessions, and file handling
VBScript Reference: Classic ASP blog with file storage or database
blog_app/
├── app.py
├── posts.json
└── templates/
├── base.html
├── home.html
├── post.html
├── edit.html
└── login.html
Objective: Same as Exercise 3, but implemented in PHP
Requirements: Same as Exercise 3
blog_php/
├── index.php
├── includes/
│ ├── functions.php
│ └── auth.php
├── data/
│ └── posts.json
└── pages/
├── home.php
├── post.php
├── edit.php
└── login.php
Objective: Build a complete CRUD application with search and pagination
VBScript Reference: Classic ASP contact management with database
Objective: Same as Exercise 5, but implemented in PHP
Requirements: Same as Exercise 5
Objective: Build a complex web application with multiple features
Objective: Same as Exercise 7, but implemented in PHP
Requirements: Same as Exercise 7
Objective: Learn to create REST APIs
Implement in both Python (Flask) and PHP
Objective: Learn WebSocket programming and real-time features
Implement in both Python (Flask-SocketIO) and PHP (ReactPHP)
To begin working on these exercises:
After completing these exercises, you'll have solid experience with both Python and PHP web development. Consider these next steps:
Remember, the goal is not just to complete the exercises, but to understand the concepts and be able to apply them to your own projects. Take your time, experiment, and most importantly, have fun learning!