Webcam in php

Recently, I got a project for an online DTR system which required the user to have a snapshot of himself/herself first. I really had the trouble doing it since I am not very good in web programming. I searched in Google about using a webcam in php but I was not productive with it. I got really frustrated because as simple as it sounds when the client had me do it, I didn't know how. Well, to be able to pursue the project, I improvised. What I did was create a desktop application using C# that uses an online database in MySQL. The program can read a usb webcam and upload the picture via ftp to the web server. The reports reside on the website so it can be viewed anywhere without installing the application. The problem came when the hosting provider stopped allowing remote MySQL connections due to security reasons. Rather than finding another hosting (I've tried 4 already and they all have one disadvantage or two), I'm trying to find ways to code in php where I can make use of a client's webcam. I'm now back at a bottleneck! I've seen some samples in flash where it is very easy using the webcam but when php comes into picture, there is always an issue. One is that it needs to use the GD library from which the hosting providers I currently have do not support. Sigh...

If only flash can get a snapshot from the webcam and be able to convert it to jpeg and save it to the server without using the GD library... I'm still searching...

The code in actionscript is really easy when you want to use a webcam. You just use
Camera.get(); and attach it to a video object.

Comments

4 Responses to "Webcam in php"

Anonymous said... June 16, 2009 at 10:21 PM

Try to use FTP instead of SQL.

MGrandis said... July 1, 2009 at 12:41 AM

Ok so use php local to the mysql database (ie on same server) and communicate PHP to PHP - its easy see http://www.webmaster-a.com/php-encrypted-communication-between-servers.php for info.

fiShBoN3 said... July 1, 2009 at 11:37 AM

Problem has been solved. I used flash to generate the image and php to save the image via $GLOBALS["HTTP_RAW_POST_DATA"]

kelly630 said... July 10, 2011 at 3:42 AM

Hi, I need help urgently in developing my final project which involving the use of Webcam.

I'm planning to develop the webcam by php scripts. However I can't find any codes that allow me to do so. Is that any suggestion out there?