How can we create id for files like 'example.com/download.php?id=1254'
?
please help me friends!?
?
please help me friends!?
<?
if (isset($_GET['ID']))
{
mysql_connect("localhost", "root", "");
mysql_select_db("DATABASE");
$ID = (int) $_GET['ID'];
$sql = "SELECT URL FROM TABLE_NAME WHERE ID = $ID LIMIT 1";
$result = mysql_query($sql);
if (mysql_num_rows($result) == 1)
{
$row = mysql_fetch_assoc($result);
//Redirect user to the file
$download_url = "http://example.com".$row['URL'];
header("Location: $download_url");
exit();
}
else
{
echo "Not found!";
}
}
?>
<?
if (isset($_GET['ID']))
{
mysql_connect("localhost", "root", "");
mysql_select_db("DATABASE");
$ID = (int) $_GET['ID'];
$sql = "SELECT URL FROM TABLE_NAME WHERE ID = $ID LIMIT 1";
$result = mysql_query($sql);
if (mysql_num_rows($result) == 1)
{
$row = mysql_fetch_assoc($result);
//Redirect user to the file
$download_url = "http://example.com".$row['URL'];
header("Location: $download_url");
exit();
}
else
{
echo "Not found!";
}
}
?>
Comment