-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendimage.php
More file actions
37 lines (27 loc) · 843 Bytes
/
Copy pathsendimage.php
File metadata and controls
37 lines (27 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
//require("config.inc.php");
// Get image string posted from Android App
$base=$_REQUEST['image'];
// Decode Image
$binary=base64_decode($base);
header('Content-Type: bitmap; charset=utf-8');
$file = fopen('image.png', 'wb');
// Create File
fwrite($file, $binary);
fclose($file);
echo 'Image upload complete, Please check your php file directory';
$fp = fopen('testfile.txt', 'w');
fwrite($fp, $binary);
fclose($fp);
//Database Entry Code
//Adding a time Stamp
$today=getdate();
$postdate=$today['yday'];
$name= $_REQUEST['name'];
$image= $base;
$con=mysql_connect("localhost","kaif15","real madrid");
mysql_select_db("flyers",$con);
$qry="INSERt INTO bulletin (name,flyer,PostDate) VALUES ('$name','$image','$postdate')";
$result=mysql_query($qry,$con);
mysql_close($con);
?>