Farmer store E-commerce Website using PHP, html, mySQL and XAMPP.
FarmerStore is a PHP–MySQL based web application designed as an online store for agricultural products such as seeds, fertilizers, and farming equipment. The platform allows users (farmers/customers) to register, log in, browse products, and manage their shopping activities through a simple and responsive interface built with Bootstrap.
The project demonstrates core full‑stack concepts including user authentication, session management, database integration, and CRUD operations using PHP and MySQL.
Acts as the landing page of the website. Displays the FarmerStore branding and introduction. Shows available agricultural products with images.Uses Bootstrap for a responsive and mobile-friendly layout. Checks user session to customize navigation options (Login / Logout).
Allows new users to create an account. Registration form collects Name, Email, Password, Contact information.
Client-side validation using HTML attributes. Backend validation and insertion handled in user_registration_script.php. Passwords are securely stored (hashed) in the database. Redirects users to a success page upon successful registration.
Provides an authentication form for existing users. Validates user credentials against the database. Uses PHP sessions to maintain login state. On successful login: User session is created, User is redirected to the main store/dashboard. On failure: Displays an error message.
The Farmer Dashboard acts as the personalized landing area for logged-in farmers/users. Once authenticated, users are redirected to this dashboard, where they can interact with the platform based on their account.
Key functionalities:
Displays farmer-specific information after login
Allows farmers to browse available agricultural products such as seeds, fertilizers, and equipment
Shows product details including name, image, and price
Enables farmers to add selected products to their cart
Uses session-based authentication to ensure only logged-in users can access the dashboard
Navigation options dynamically change based on login status (Dashboard, Cart, Logout)
Purpose: The farmer dashboard improves usability by giving users a centralized place to manage their shopping activities and interact with the store efficiently.
The Cart module allows farmers to temporarily store products they intend to purchase. It bridges the gap between browsing products and completing an order.
Key functionalities:
Stores selected products using user sessions or database mapping
Allows farmers to:
Add items to the cart
View all selected items in one place
Remove items from the cart
Displays product summary such as:
Product name
Quantity
Price
Ensures that cart data is user-specific and persists during the session
Prevents duplicate entries of the same product for the same user
Purpose: The cart provides a convenient way for farmers to review and manage their selected products before proceeding to checkout, improving the overall shopping experience.
The Company Dashboard is designed for administrators or sellers who manage the products available on the platform. This dashboard focuses on backend management rather than purchasing.
Key functionalities:
Allows companies/admins to:
Add new products to the store
Update existing product details (price, category, images)
Remove products from the inventory
Displays a list of all products currently available in the store
May track user interactions such as product demand or selection frequency
Restricted access using authentication and role-based checks
Purpose: The company dashboard enables efficient management of the store inventory, ensuring that farmers always have access to updated and accurate product information.
PHP sessions are used to: Track logged-in users, Restrict access to authenticated pages, Session checks prevent unauthorized access, Sessions are destroyed during logout.
Ends the current user session. Clears all session variables. Redirects the user back to the login or home page.
Users Table:
Stores registered user details,
Fields include user ID, name, email, password, and contact info.
Items Table: Stores product information such as: Product name, Price, Category, Image reference.
Users_Items Table: Acts as a junction table to manage orders and delivery, Establishes a relationship between users and items, Tracks which user has selected or purchased which item, Uses foreign keys for referential integrity.
Products such as seeds, fertilizers, and farming equipment are displayed using images from the img/ folder. Each product card includes: Image, Product name, Price, and the option to add to cart. Designed using Bootstrap cards and grid system.
Install XAMPP / WAMP
Copy the FarmerStore folder into the htdocs directory
Start Apache and MySQL services
Import store.sql into phpMyAdmin
Update database credentials in connection.php
Open browser and navigate to: http://localhost/FarmerStore/index.php
FarmerStore is a beginner-friendly full-stack PHP project made by Mokshita Yadav that demonstrates essential web development concepts such as authentication, session handling, database relationships using mySQL and XAMPP, and responsive UI design with practical PHP-MySQL integration.