Problem with the OGG link
Moderators: snarkout, Patrick, dann
Problem with the OGG link
I found issues triying to download the Ogg file for yesterday's show.
Alexandro COLORADO
Linc wrote the PHP for the mirror script. Generally it's a bad idea to open the code to an internet facing script unless you've had sufficient time to test it for security.Jza wrote:hey pat can you open me the source for the randomizer, I am looking for a randomizer script for the OOo site so we dont have users scrolling down throught he mirror list. Thanks.
If you ask nice Linc might tell you what PHP function he used to pick a random mirror.
The majority of it looks like this:Gomer_X wrote:Linc wrote the PHP for the mirror script. Generally it's a bad idea to open the code to an internet facing script unless you've had sufficient time to test it for security.Jza wrote:hey pat can you open me the source for the randomizer, I am looking for a randomizer script for the OOo site so we dont have users scrolling down throught he mirror list. Thanks.
If you ask nice Linc might tell you what PHP function he used to pick a random mirror.
Code: Select all
<?
if(!isset($_GET['fname'])) { header("Location: http://tllts.org"); exit; }
$fname=$_GET['fname'];
$db = mysql_connect("$host", "$username", "$password");
mysql_select_db("$database",$db);
$query = "select link from mirror where link like '%$fname%'";
$result = mysql_query($query,$db) or die(mysql_error());
$recs = mysql_num_rows($result);
$counter='0';
while ($myrow = mysql_fetch_array($result))
{
$counter++;
$link[$counter]=$myrow['link'];
}
srand((double)microtime()*1000000);
$mirrorno=rand(0,$recs);
if ($mirrorno=='0')
{
$query = "select link from audio where link like '%$fname%'";
$result = mysql_query($query,$db) or die(mysql_error());
while ($myrow = mysql_fetch_array($result))
{
$link[$counter]=$myrow['link'];
}
}
header("Location: $link[$mirrorno]");
?>
-Linc Fessenden
In the Beginning there was nothing, which exploded - Yeah right...
In the Beginning there was nothing, which exploded - Yeah right...