i have a php page that execute a sql querry to protect a download link
like u r download link is this
www.domain.com/folder/songs.mp3
now it convert like this
www.domain.com/jump.php?id=2
the jump.php page contain
~~~ ( begin code ) ~~~
<?php
$id = htmlspecialchars($_GET['id'], ENT_QUOTES);
$db_name = "yourdatabasename";
$table_name = "redirects";
$cnx = mysql_connect("localhost", "yourdatabasename", "yourpassword")
or die("Couldn't connect.");
$db = mysql_select_db($db_name, $cnx)
or die("Couldn't select database.");
$sql = "SELECT id, address FROM $table_name
WHERE id = '$id'";
$result = mysql_query($sql,$cnx)
or die("Couldn't execute query.");
while ($row = @mysql_fetch_array($result)) {
$id = $row["id"];
$address = $row["address"];
}
header("location: $address");
?>
~~~ ( end code ) ~~~
and the sql querry for this is
CREATE TABLE redirects ( id mediumint(8) unsigned NOT NULL auto_increment, address varchar(200) NOT NULL, label varchar(60) NOT NULL, PRIMARY KEY (id), KEY id (id, address), UNIQUE id_2 (id));
after that u have to insert url or lable in redirects table through sql querry.
now when i m going to click on a url of jum.php
it will display a error
Couldn't execute query. :xbones:
can someone help me to solve it