[insert_php]
$servername = “localhost”;
$username = “i3197318_wp1”;
$password = “R.5ZRMDdSOhTsm7a5Dr41”;
// Create connection
$conn = new mysqli($servername, $username, $password,’i3197318_wp1′);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}else{
}
$key = $_GET[‘key’];
$query = “SELECT is_active FROM link_generation WHERE number=”.$key;
$res = mysqli_query($conn,$query);
$row = mysqli_fetch_row($res);
if($row[0] ==1){
//proceed to download
$query2=”UPDATE link_generation set is_active = 0 WHERE number =”.$key;
echo $query2;
mysqli_query($conn,$query2);
sleep(3);
header(‘Location:https://www.dropbox.com/s/xtho4r3jqzh88m9/ABTS_Setup.zip?dl=1’);
}else{
echo “The link is no longer valid”;
}
[/insert_php]