| 1280 번 글의 답장글: Re: Re: [PHP/MP3] APACHE/PHP4 base module(?)질문 |
| 글쓴이: 윤재병
|
글쓴날: 2003년 01월 13일 22:17:02 월(저녁) |
조회: 648 |
글수정이 없네요..
이 방법으로는 디렉토리 이름에 공백문자가 있으면 안되는
군요..
한글도 되는것 같습니다만.. 제 상황에서만 되는걸지도...
아마 한글때문에 base64_encode를 쓰신거 같은데요.. 맞는지요?
[윤재병]님이 남기신 글:
>디렉토리 선택은 일단 성공하였습니다.
>
>
>## configuration ################################
>##
>$path='/www/mp3';
>$not = 0; // don't print check microtime result
>//$dir='/GOODS';
>$mp3_dir = "$path"."$dir"; // do not set ducumentroot inside
>//$lame = '/usr/local/bin/lame'; // require lame(http://www.mp3dev.org/)
>$log_dir = '/www/mp3/log'; // logging directory(nobody access and
writable)
>##
>## end configuration #############################
>
>이렇게 $path에 mp3기본 디렉토리를 정하고 $dir을 주소로
?dir=/fsdfsd 이런식으로 하여 합친 $mp3_dir을 사용하였습니다.
>
>
>## mp3 playlist core module
>## 2002.05.15 patch random play(for direct access BAD user)
>##
>function php_mp3plist($mp3_dir, $mp3list='', $player='') // $mp3list =
array();
>{
> global $_SERVER, $dir;
>
> if(is_array($mp3list)) {
> if($player) { // for BAD user
> $randkey = array_rand($mp3list);
> if(is_readable("$mp3_dir/".base64_decode($randfile=$mp3list[$randkey])))
{
> $ftype = get_ftype($randfile);
> header("Location:
http://$_SERVER[HTTP_HOST]$_SERVER[_PHP_SELF]".
> "?dir=$dir&stream=$randfile$ftype[ext]");//윈앰프에
넘기를 리스트에 $dir을 첨가하였습니다.
> }
> exit;
> }
> header('Content-Disposition: inline; filename=playlist_lcn.m3u');
> header('Content-Type: audio/x-mpegurl');
> foreach($mp3list AS $k=>$v) {
> if(is_readable($mp3file="$mp3_dir/".base64_decode($v))) {
> $vd="dir=$dir";
> $ftype = get_ftype($mp3file);
> echo "http://$_SERVER[HTTP_HOST]$_SERVER[_PHP_SELF]".
> "?$vd&stream=$v$ftype[ext]\n";]");//윈앰프에
넘기를 리스트에 $dir을 첨가하였습니다.
>
> }
> }
> } else exit; // stop
>}
>
>[윤재병]님이 남기신 글:
>
>>답변 대로 하니까 잘되는군요.
>>제가 이소스를 가지고, 파일리스트를 보여주면서 음악파일을
선택하는 걸 짜려고 합니다. 처음 시도로
play.php?mp3_dir=/www/mp3/a_capella
>>이런식으로 부르니까 윈앰프의 파일 리스트는 뜨는데
주소에러 같은걸로 플레이를 못합니다. 물론 unset($mp3_dir);은
주석처리 했습니다.
>>
>>왜그런거죠?
>>
>>먼가 원본적인 제한이 있는지요?
>>소스안에 $mp3_dir이 정의 되어있으면 정상작동 되고 외부에서
play.php?mp3_dir=/www/mp3/a_capella 이런식으로 하면 안되는 이유가
뭘까요..
>>
>>그럼 좋은 하루 되세요.
>
>========================================
>
========================================
|
이전글 : Re: [PHP/MP3] APACHE/PHP4 base module(?)질문
다음글 : Re: Re: Re: [PHP/MP3] APACHE/PHP4 base module(?)질문
|
from 210.123.117.165
JS(Redhands)Board 0.4 +@
|