I’m trying to fetch/get the url or entire name of image i capture from a video. I’ve managed to save the capture as an image in the server with a random name but cannot get the url or entire name to echo or even am able to save it to the mysql instead i keep getting the name resource 4 or 2341 number repeating inside the mysql database however a new image with a new random name appears in the server. The post img val is the capture image.
[code=php]<?php
include(‘connect.php’);
$rawData = $_POST[‘img_val’];
$filteredData = explode(‘,’, $rawData);
$unencoded = base64_decode($filteredData[1]);
$randomName = rand(0, 99999);;
//Create the image
$fp = fopen($randomName.’.png’, ‘w’);
fwrite($fp, $unencoded);
$mb = fopen($fp, ‘r’);
fclose($fp);
$q=mysql_query(“insert into images (name) values($fp)”) or die (mysql_error());
?>