Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   phphq.Net Forums (https://novahq.net/forum/forumdisplay.php?f=277)
-   -   index.php?x=blahblah.mp3 (https://novahq.net/forum/showthread.php?t=38605)

brian 02-12-2005 03:19 PM

index.php?x=blahblah.mp3
 
I have been looking all over the internet for a php script like this. Where you have the file and when u click the link it generates the page for you.

Here is an example on eBaumsworld:http://www.ebaumsworld.com/morepranks.shtml
When you hover over the "Call" link you get that extension. And this would really help me with my site....

Anyone know where I can get a script like this? Or the correct name for this kind of script :?:


(Sorry for being a noob :oops:)

Scott 02-13-2005 12:47 PM

It's just a simple file database, hotscripts.com has many like this.

varg 02-15-2005 06:20 PM

You'll need a database with at least two tables (name and url)
then use something like this code to generate a list of all the rows (entries) in that database.
PHP Code:

<?
$sql = mysql_query("SELECT * FROM database ") or die (mysql_error());

while ($row = mysql_fetch_array($sql)) {
$name = $row["name"];
$url = $row["url"];

echo "<a href=\"folder/$url.mp3\">$name</a><br />";

}

?>

I think that should work, but I'm still kinda new to php coding.

Guest 01-09-2006 05:54 PM

varg, you really wouldnt need a mysql database to load the files. this is what i would do,

// first get the file thats being called. Example: ?load=this.mp3

$file = $_GET['load'];

header("location: path to the file/".$file");


All times are GMT -5. The time now is 06:49 PM.

Powered by vBulletin®