-
Notifications
You must be signed in to change notification settings - Fork 3
/
SendPic.php
40 lines (26 loc) · 868 Bytes
/
SendPic.php
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
38
39
40
<?php
//-------------------------------------------------------
//Imports
require_once('connections.php');
//Connctions Settings :
ignore_user_abort(true) ;
set_time_limit(0);
//-------------------------------------------------------
xSendPic($_GET["Url"] , $_GET["SendTo"]);
function xSendPic($url,$SendTo){
$context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n'))); //Make the conn faster
$time = generateUploadId();
$ThreadID = GetThreadID($SendTo);
if ($ThreadID != ""){
$pic = file_get_contents($url,false,$context);
if (UploadPic($time,strlen($pic),$pic) != ""){
if (SendPic($ThreadID,$time) != ""){
// change status --> sent
die($ThreadID . " : Done");
}else{
die($ThreadID . " : Fail");
}
}
}
}
?>