Javascript函数我用来发送变量“dir”
function getSelectVar1(obj){
location.href = '<?=$THIS_FILE?>?dir=' + obj.value;
}
我用来发送变量“dir”的表单。
<FORM name=directoryForm method=GET ACTION='$PHP_SELF'>
<tr class='headercontent'>
<td align=center width='240' class='header' >Select Directory </td>
<td width='460'>
<SELECT style='background:c0c0c0;' NAME=dir id='dir' onChange='getSelectVar1(dir)'>";
if ( $DIR_PATH != '.' ) {
echo "<OPTION VALUE='.'> Problem All </OPTION>";
}
echo "<OPTION VALUE='$DIR_PATH' selected>$DIR_PATH_RESULT</OPTION>";
$z = 0;
while( $z < $data_num ) {
if ( is_dir("$DIR_PATH/$other_FILES[$z]") && $other_FILES[$z] != '.' && $other_FILES[$z] != '..') {
echo "<OPTION VALUE='$DIR_PATH/$other_FILES[$z]'>$DIR_PATH_RESULT/$other_FILES[$z]</OPTION>";
}
$z++;
}
echo "</SELECT></td> </form>""
我用$ _GET来获取变量'dir'
$dir=$_GET[dir];
但是我得到了“未定义的变量”
如何解决此问题?