Skip to content

A simple PHP + MySQL form to store movie details with server-side validation and prepared statements.A simple PHP + MySQL form to store movie details with server-side validation and prepared statements.

Notifications You must be signed in to change notification settings

hcsarker/Movie_archive_form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Archive Form

A simple PHP + MySQL form to store movie details with server-side validation and prepared statements.

Prerequisites

  • PHP 7.4+ (XAMPP/LAMPP OK)
  • MySQL/MariaDB
  • Web server serving this folder (e.g., http://localhost/Movie_archive_form/)

Setup

  1. Update database credentials in db.php if needed.
  2. Create the database movie_archive and the movies table:
    • Import schema.sql into your MySQL server, or run the SQL manually.

Schema

See schema.sql for the table definition:

CREATE TABLE movies (
  id INT AUTO_INCREMENT PRIMARY KEY,
  movie_name VARCHAR(255) NOT NULL,
  movie_type VARCHAR(100) NOT NULL,
  release_date DATE NOT NULL,
  producer_name VARCHAR(255) NOT NULL,
  rotten_tomato_rating DECIMAL(3,1) NOT NULL
);

Usage

  • Open index.php in your browser.
  • Fill the form and submit. You will be redirected back with a success or error message.

Testing

You can use curl to simulate a form submission:

curl -i -X POST \
  -d "movie_name=Inception" \
  -d "movie_type=Sci-Fi" \
  -d "release_date=2010-07-16" \
  -d "producer_name=Emma Thomas" \
  -d "rating=8.8" \
  http://localhost/Movie_archive_form/store.php

(After submission, you should be redirected to index.php with a success message.)

Notes

  • Input validation enforces date format YYYY-MM-DD and rating between 0 and 10.
  • Database connection uses utf8mb4 charset for full Unicode support.

Background Image

The page includes a subtle movie-themed background (assets/movie-bg.svg) layered under gradient overlays.

  • To customize, replace assets/movie-bg.svg with your own image (e.g., assets/my-movie.jpg) and update assets/styles.css body background to point to it.
  • Recommended size: 1920x1080 or higher; use visually soft imagery to keep the form readable.

About

A simple PHP + MySQL form to store movie details with server-side validation and prepared statements.A simple PHP + MySQL form to store movie details with server-side validation and prepared statements.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published