MudMan23
MudMan23

Reputation: 821

How to capture photo via HP or tablet and automatically upload it using PHP?

Can you help me with this problem? I want to make program in PHP and use Jquery mobile. I want it to capture a photo from the device's camera.

What method or function can I use? A php library or something?

Upvotes: 1

Views: 1624

Answers (2)

Eonasdan
Eonasdan

Reputation: 7765

You cannot access the camera without an application on the device.

With some devices, like Android, you can have an upload file field in an HTML form that can access the users photo gallery (pictures they have already taken). All iSheep products (iphone, ipad) prevent this access however and require an application for this.

<form ...>
<input type="file"/>
...
</form>

I second the use of PhoneGap to help with creating the application. You will be able to write javascript that runs on the device. You will have to create apps for each type of device however.

Upvotes: 0

Joel Murphy
Joel Murphy

Reputation: 2512

Firstly, you are mentioning multiple programming languages here. Javascript is a client side language (which means it will run straight from the user's device). PHP is a server side scripting language (which means you have no control of the code, and it must be run on a server).

Secondly, from my knowledge, it's not yet possible to have access to a device's camera using Javascript in a browser. You will have to make use of a device's native functions. I recommend reading about PhoneGap library. PhoneGap will simplify what you want to do, and will reduce the amount of learning time you will need to spend writing an app for each device, as code is very similar across multiple platforms.

Upvotes: 2

Related Questions