Reply to Re: Trouble with function calls

Your name:

Reply:


Posted by naixn on 12/02/06 13:43

Brian Huether wrote :
> 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
>
> <?php
>
> function ServeAudio($file) {
>
> echo $file;
> //header("Location: " .$file);
>
> }
> ?>
>
> To test it, I have a file called audiotest.php that contains
>
> <body>
> <a href = "audio.php?op=ServeAudio&file =
> <?php
> echo "http://blah.mp3";
> ?>">file</a>
> </body>
>
> But I can not get it to successfully enter the ServeAudio function.
>
> thanks,
>
> brian
>
>
>

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

1/ First solution :
<?php

echo $_GET['file'];

?>

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

function ServeAudio($file)
{
echo $file;
}

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

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

?>

--
Naixn
http://fma-fr.net

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация