PHP Classes

PHP Webcam Capture: Save picture taken from Webcam to a file or MySQL

Recommend this page to a friend!
  Info   View files Example   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-04-28 (23 days ago) RSS 2.0 feedStarStarStarStar 72%Total: 433 This week: 51All time: 6,035 This week: 12Up
Version License PHP version Categories
webcam-in-php 1.0.1GNU General Publi...5HTTP, PHP 5, Graphics, Files and Folders
Description Author

This class can save picture taken from Webcam to a file or MySQL.

It can take a request sent from a JavaScript script that takes a snapshot of a image taken with the Webcam and saves the image to a server file.

The class serves the path of the saved image as output of the handler script, so the browser can display it to the user.

The image can also be saved to a MySQL database table record.

Innovation Award
PHP Programming Innovation award nominee
April 2017
Many Web sites need to take pictures of their users. One way to achieve this is to take a snapshot of the user image using his computer or mobile device Webcam.

This class can take pictures captured using a Webcam and uploaded to the server, so it can save the images to server files or a MySQL database table.

Manuel Lemos
  Performance   Level  
Name: Vivek moyal <contact>
Classes: 4 packages by
Country: India India
Age: ???
All time rank: 2369148 in India India
Week rank: 15 Up2 in India India Up
Innovation award
Innovation award
Nominee: 1x



This repository will help you to integrate and save the captured image to the database or local folder.


Here are some code structure to understand the important parts of this class.

$imageFolder="your folder"; - This is your folder where you would like to save the file
showImage() - This function will get the image and return the name including the path

If you want to save the image to database than you can use this function.

changeImagetoBase64() - This function will change the image to base64 
saveImageToDatabase() -  It will help you to save the image to database
  Files folder image Files  
File Role Description
Plain text file connectionClass.php Class Database connection class file
Accessible without login Plain text file webcam.js Data JS file for accessing the webcam features
Accessible without login Image file webcam.swf Data Webcam swf file for showing the camera window
Plain text file webcamClass.php Class Webcam class file to get the image and save the image
Accessible without login Plain text file action.php Example Example script
Accessible without login Plain text file index.php Example Index file for showing the webcam
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation
Accessible without login Plain text file webcam.sql Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
This week:51
All time:6,035
This week:12Up
User Ratings User Comments (2)
 All timeMonth
17 hours ago (Indika Kulasinghe)
without shutter.
21 days ago (KillerDr)