Trouble with function calls

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This relates to my previous posts about protecting mp3 files.

 I have forgotten a lot of my
PHP knowledge. For istance, say I have a file called audio.php that contains


function ServeAudio($file) {

     echo $file;
     //header("Location: " .$file);


To test it, I have a file called audiotest.php that contains

<a href = "audio.php?op=ServeAudio&file =
echo "http://blah.mp3 ";

But I can not get it to successfully enter the ServeAudio function.



Re: Trouble with function calls

Brian Huether wrote :
Quoted text here. Click to load it

Well... Here you're nowhere calling the ServeAudio function in the audio.php
Here what you should do :

1/ First solution :

echo $_GET['file'];


2/ Second solution, if you have different functions to call :

function ServeAudio($file)
   echo $file;

function BlahBlah($file, $nb)
   echo 'the' . $nb . $file;

$func = $_GET['op'];
call_user_func_array($func, $_GET);



Site Timeline