Send photo to my server

hello,

I'm using this blocks to send photo to my server via PHP and working good , but need send photo name now the photo name is a time and date .
check a attachment for view code and blocks

any advice please
thanks.


<?PHP // mysql server $dbserver = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname ='tsforms'; $t=time(); $imgName = date("Y-m-d",$t); $target_dir = 'uploads/'; $data = file_get_contents('php://input'); if (!(file_put_contents($target_dir . $imgName. " __ ". $t. ".jpg",$data) === FALSE)) { $con = mysqli_connect($dbserver,$dbuser,$dbpass,$dbname); $sql = "INSERT INTO all_img VALUES ('$target_dir . $imgName. __ . $t. .jpg')"; mysqli_query($con,$sql) or die(mysqli_error(). "
Line: ". __LINE__ ."
$sql"); mysqli_close($con); echo 'OK'; }else echo 'failed'; ?>

Perhaps, by this way you can rename the camera pic and save it to a location using canvas and choose it from there to upload to your php server,

and how to have date and time, here it is

This may help (does not use mysql)