-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogdrop.php
More file actions
25 lines (21 loc) · 812 Bytes
/
logdrop.php
File metadata and controls
25 lines (21 loc) · 812 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
<?php
session_start();
if(!isset($_SESSION['user']))
header('Location: login.php');
$manageid=$_SESSION['user_id'];
include 'config.php';
$drop = $_POST['dropname'];
$dropid = $_POST['dropid'];
$con = mysql_connect($mysqlserver,$mysqluser,$mysqlpass);
if(!$con)
die('Could not connect: '.mysql_error());
mysql_select_db($mysqldb);
$select = (mysql_query(sprintf("SELECT token FROM drops WHERE name = '%s' AND id ='%s' AND user_id = '$manageid'", mysql_real_escape_string($drop), mysql_real_escape_string($dropid))));
$grab = mysql_fetch_array($select, MYSQL_ASSOC);
mysql_close($con);
$token = $grab['token'];
//Create API complaint link signature to Drop
$qhour=time() + (1 * 60);
$sig=sha1($qhour.'+'.$token.'+'.$drop);
echo "http://drop.io/$drop/from_api/?version=1.0&signature=$sig&expires=$qhour";
?>