Please tell me what's wrong here...

Please tell me what’s wrong with this setup, it simply won’t work. My database is fine as far as I know.

Index.php

[code]

[/code]

playlist.xml

[code]<?xml version=”1.0? encoding=”UTF-8??>

MP3 Playlist http://www.listentoenya.co.za/ A DAy Without Rain http://www.listentoenya.co.za/mp3.php?ID=6oghq846vga22wqzop06ygdmn7537f

[/code]

mp3.php

[php]<?php

if (! preg_match(’/^[-a-z.-@,‘s]*$/i’,$_GET[‘ID’]))

{

die(‘No illegal characters’);

}

else

$empty=strlen($_GET[‘ID’]);

if ($empty==0)

{

die(‘The text field cannot be empty’);

}

else

{

$ID = $_GET[‘ID’];

}

$username = “m7219520”;

$password = “filtered out”;

$hostname = “filtered out”;

$database = “filtered out”;

$dbhandle = mysql_connect($hostname, $username, $password)

or die(“Unable to connect to MySQL”);

$selected = mysql_select_db($database,$dbhandle)

or die(“Could not select $database”);

$ID = mysql_real_escape_string(stripslashes($ID));

$result = mysql_query(“SELECT Real URL FROM MP3 WHERE ID=’$ID’”)

or die(mysql_error());

$row = mysql_fetch_array( $result )

or die("Invalid query: " . mysql_error());

$direction = $row[‘URL’];

$path=‘http://’.$direction;

header(‘Content-type: audio/mpeg’);

header('Content-Length: '.filesize($path)); // provide file size

header(“Expires: -1”);

header(“Cache-Control: no-store, no-cache, must-revalidate”);

header(“Cache-Control: post-check=0, pre-check=0”, false);

readfile($path);

mysql_close($dbhandle);

?>[/php]

Firstly: Can you please put your code in [php] tags.
Second: What are you trying to do and what errors do you get

Sorry, it’s my first time posting on this forum.
What I’m trying to do is stream MP3 to the index.php file from the mp3.php but it won’t work. I don’t get any errors. Look here http://www.listentoenya.co.za

To the mod who changed my post, the playlist.xml part should be in a seperate block.

Appologies! Fixed.

Sponsor our Newsletter | Privacy Policy | Terms of Service