2022-10-23 18:15:14 +07:00
|
|
|
<?php
|
|
|
|
|
2022-10-25 14:46:33 +07:00
|
|
|
$servername = "127.0.0.1";
|
|
|
|
$username = "dbusr";
|
|
|
|
$password = "securepwd";
|
|
|
|
$dbname = "appdb";
|
2022-10-23 18:15:14 +07:00
|
|
|
|
|
|
|
//Query params
|
|
|
|
$q = $_REQUEST["q"];
|
|
|
|
$vid = $q.".mp4";
|
|
|
|
|
|
|
|
// Create connection
|
|
|
|
$conn = new mysqli($servername, $username, $password, $dbname);
|
|
|
|
// Check connection
|
|
|
|
if ($conn->connect_error) {
|
|
|
|
die("Connection failed: " . $conn->connect_error);
|
|
|
|
}
|
|
|
|
|
|
|
|
$sql = "SELECT status FROM meme WHERE session='".$q."' ORDER BY id DESC LIMIT 1";
|
|
|
|
$result = $conn->query($sql);
|
|
|
|
|
|
|
|
|
|
|
|
if ($result->num_rows > 0) {
|
|
|
|
// output data of each row
|
|
|
|
while($row = $result->fetch_assoc()) {
|
|
|
|
if($row["status"] == "1"){
|
|
|
|
echo "<a href=\"$vid\">Click here</a>";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo "Processing";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
echo "0 results";
|
|
|
|
}
|
|
|
|
$conn->close();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|