wavs 디렉토리 절대경로에서 상대경로로 변경

This commit is contained in:
gnuboard
2013-01-04 15:16:15 +09:00
parent 7fb3a13922
commit 3dfea05d47
3 changed files with 4 additions and 15 deletions

View File

@ -2,8 +2,8 @@
include_once("./_common.php");
// prepare an array of wavfiles
$lc ='/home/tmp/g4s/plugin/captcha/wavs/';
$wav = $lc.'captcha.wav';
$wavs_dir = $g4['path'].'/plugin/captcha/wavs/';
$wav = $wavs_dir.'0.wav';
$fields = join('/',array( 'H8ChunkID', 'VChunkSize', 'H8Format',
'H8Subchunk1ID', 'VSubchunk1Size',

View File

@ -2,25 +2,14 @@
include_once("./_common.php");
// prepare an array of wavfiles
$lc ='/home/tmp/g4s/plugin/captcha/wavs/';
$wavs_dir = $g4['path'].'/plugin/captcha/wavs/';
$number = (string)$_SESSION['ss_captcha_key'];
$wavs = array();
for($i=0;$i<strlen($number);$i++){
$file = $lc.$number[$i].'.wav';
//echo $file;
if(!@file_exists($file)) {
$file = $en.$code{$i}.'.wav';
}
$file = $wavs_dir.$number[$i].'.wav';
$wavs[] = $file;
/*
for ($d=0;$d<rand(0,5);$d++) {
$wavs[] = $lc.'delay'.rand(0,1).'.wav';
}
*/
}
//print_r($wavs); exit;
header('Content-type: audio/x-wav');
header('Content-Disposition: attachment;filename=captcha.wav');

Binary file not shown.