|
 |
|
วานผู้รู้ช่ วยดูโค๊คให้หน่อยครับ มัน error เรื่องของการรับค่าครับ |
|
 |
|
|
 |
 |
|
จากโค้ด หน้าจอนี้จะรับค่าจาก อีก page คือ num=123456
แล้วเราจะ ใส่ตรง url ยังไงครับ (ตัวสีแดง) ลองใส่ตัวเลขตรงๆ run ได้ ปกติครับ ผมไม่เก่งเรื่อง script ช่วยทีนะครับ ขอบคุณครับ
Code
<?php
error_reporting(0); // Set E_ALL for debuging
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
// Required for MySQL storage connector
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
// Required for FTP connector support
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
/**
* Simple function to demonstrate how to control file access using "accessControl" callback.
* This method will disable accessing files/folders starting from '.' (dot)
*
* @param string $attr attribute name (read|write|locked|hidden)
* @param string $path file path relative to volume root directory started with directory separator
* @return bool|null
**/
function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself
}
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../../EMR_IMAGES/' . $_GET["num"] . '/opd/EMR/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../EMR_IMAGES/[b]'.$_GET["num"].'[/b]/opd/EMR/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
Tag : PHP, JavaScript, jQuery

|
|
 |
 |
 |
 |
Date :
2014-03-17 17:55:45 |
By :
pinto2004 |
View :
1313 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยดูให้หน่อยนะครับ
|
 |
 |
 |
 |
Date :
2014-03-18 08:11:30 |
By :
pinto |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไม่มีใครตอบ T-T
|
 |
 |
 |
 |
Date :
2014-03-18 19:57:54 |
By :
pinto |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนด้วยครับ
|
 |
 |
 |
 |
Date :
2014-04-09 04:20:13 |
By :
pinto |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอามาใส่ syntax highlight ให้ใหม่ จะได้อ่านง่ายๆ
Code (PHP)
<?php
error_reporting(0); // Set E_ALL for debuging
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderConnector.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinder.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeDriver.class.php';
include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeLocalFileSystem.class.php';
// Required for MySQL storage connector
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
// Required for FTP connector support
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
/**
* Simple function to demonstrate how to control file access using "accessControl" callback.
* This method will disable accessing files/folders starting from '.' (dot)
*
* @param string $attr attribute name (read|write|locked|hidden)
* @param string $path file path relative to volume root directory started with directory separator
* @return bool|null
**/
function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself
}
$opts = array(
// 'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => '../../EMR_IMAGES/' . $_GET["num"] . '/opd/EMR/', // path to files (REQUIRED)
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../EMR_IMAGES/'.$_GET["num"].'/opd/EMR/', // URL to files (REQUIRED)
'accessControl' => 'access' // disable and hide dot starting files (OPTIONAL)
)
)
);
// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
จริงๆดูแล้วก็โค้ดไม่น่าจะผิดอะไรนะ ทดลอง echo ดูรึยังครับว่าค่า $_GET นี้ได้อะไรมา
เช่น Code (PHP)
var_dump($_GET['num']);exit;
แล้วก็ค่านี้ ถ้าเวลามันไม่มีอะไรส่งมา มันน่าจะมีตัวเลข default อะไรงี้ป่าวครับ เช่น
Code (PHP)
if ($_GET['num'] == null) {
$_GET['num'] = '0';
}
อะไรแบบนี้
|
 |
 |
 |
 |
Date :
2014-04-09 04:30:37 |
By :
mr.v |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|