This web application provides an HTML/CSS/JavaScript (jQuery) registration form and PHP back-end to save and display registrations.
Files included:
index.html— registration form with jQuery AJAX, client-side validation, and animated feedback messages.save_data.php— receives POST requests, sanitizes input (full name, email, phone, gender, age), validates Gmail and phone format, appends toregistrations.txt, returns "success" or error message.show_data.php— readsregistrations.txtand displays entries in a styled table.registrations.txt— data file (created empty, populated on first submission).
Fields collected:
- Full Name
- Email Address (Gmail only - must end with @gmail.com)
- Phone Number (exactly 10 digits)
- Gender (Male/Female/Other)
- Age
Validation:
- ✅ Email must be a Gmail address (@gmail.com)
- ✅ Phone number must be exactly 10 digits (no spaces or special characters)
- ✅ All fields are required
- ✅ Client-side and server-side validation
How to run locally (Windows PowerShell):
- Open PowerShell and change into the project directory:
cd "c:\Users\mrpun\OneDrive\Desktop\php p"- Start PHP's built-in server (requires PHP installed and on PATH):
php -S localhost:8000- Open your browser and go to
http://localhost:8000/index.html.
-
Make sure Docker is installed and running
-
Build and run with Docker Compose:
docker-compose up -d-
Open your browser and go to
http://localhost:8080/index.html -
To stop the container:
docker-compose downDocker Commands:
# Build the Docker image
docker build -t php-registration-app .
# Run the container
docker run -d -p 8080:80 --name php-app php-registration-app
# View logs
docker logs php-app
# Stop the container
docker stop php-app
# Remove the container
docker rm php-app-
Fill out the form and click Register. You'll see a success message, and data is saved to
registrations.txt. -
Click View All Registrations to see the styled table of all submitted entries.
Deploying to Replit:
- Go to https://replit.com
- Click "Create Repl"
- Select "Import from GitHub"
- Paste:
https://github.com/puneetdixit200/php-project - Click "Import from GitHub"
- Click "Run" - Your app will be live instantly!
- Go to https://replit.com and create a new Repl
- Choose "PHP Web Server" template
- Upload all project files
- Click "Run"
Replit Configuration:
.replit- Automatically starts PHP server on port 8000replit.nix- Specifies PHP 8.3 and required extensions- The app will be accessible via Replit's provided URL
Important for Replit:
- The server runs on
0.0.0.0:8000(accessible externally) registrations.txtwill persist in the Repl storage- Your app gets a public URL like
https://php-project.username.repl.co
- Go to https://render.com and sign up/login
- Click "New +" → "Blueprint"
- Connect your GitHub account
- Select repository:
puneetdixit200/php-project - Render will automatically detect
render.yamland deploy! - Your app will be live at:
https://php-registration-app.onrender.com
- Go to https://render.com
- Click "New +" → "Web Service"
- Connect GitHub repository:
puneetdixit200/php-project - Configure:
- Environment: Docker
- Region: Oregon (or your choice)
- Branch: main
- Dockerfile Path: ./Dockerfile
- Click "Create Web Service"
- Wait for deployment (3-5 minutes)
Render Features:
- ✅ Free tier available
- ✅ Automatic HTTPS
- ✅ Auto-deploy on git push
- ✅ Built-in health checks
- ✅ Custom domain support
Dockerfile- Container configuration with PHP 8.3 + Apachedocker-compose.yml- Local development orchestration.dockerignore- Excludes unnecessary files from Docker imagerender.yaml- Render.com automatic deployment configuration
Notes:
- The form posts via AJAX to
save_data.php. Submissions are appended toregistrations.txtin the same folder. - For a production app, use a proper database and secure authentication. This is a demo/assignment project.
Technologies used:
- HTML5
- CSS3 (gradient backgrounds, glassmorphism effects)
- JavaScript (ES6+)
- jQuery 3.6.0 (AJAX, DOM manipulation, event handling)
- PHP (server-side processing, file I/O)
- Docker (containerization)
Enjoy! If you need help with deployment or enhancements, feel free to ask.