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'; ?>