The first thing you need is your PHP editor or IDE, a Webcam, MySQL and a cup of coffee. The PHP editor is of course for coding your PHP scripts, Webcam to take the image, MySQL for savingit in a database and Coffee is for your refreshment. :-)
To create our capturing applications we need to create three files:
- Web page for showing the webcam
- Script to handle the image upload
- Script to access to the database
- Web Page for Showing the Webcam
With this file we will show our Webcam screen on our PHP page. index.php
Here we will use the webcam.js file for the webcam functions to take the snap and save it.
We will make a form with the one text field and one button.
<form action="<?php echo HtmlSpecialChars($_SERVER['PHP_SELF']);?>" method="post"> <input type="text" name="myname" id="myname"> <input type="submit" name="send" id="send"> </form>
Below the form we will put our webcam window to show the webcam screen.