php Programming Glossary: directory_separator
limiting the checking condition while uploading swf files http://stackoverflow.com/questions/10151960/limiting-the-checking-condition-while-uploading-swf-files Wrong File dimention continue if file_exists savePath . DIRECTORY_SEPARATOR . fileName errors fileName File Exist continue if is_writable.. fileName 0 if @move_uploaded_file fileTemp savePath . DIRECTORY_SEPARATOR . fileName output fileName OK else errors fileName Error..
multi image upload wrong quantity on file-upload http://stackoverflow.com/questions/10170277/multi-image-upload-wrong-quantity-on-file-upload dirImage Construct destination path fileDst dirImage . DIRECTORY_SEPARATOR . fileName filePrifix basename fileName . . fileExt i 0 while.. i 0 while file_exists fileDst i fileDst dirImage . DIRECTORY_SEPARATOR . filePrifix . _ . i . . . fileExt Move the file if count errors..
How to get X newest files from a directory in PHP? http://stackoverflow.com/questions/1018080/how-to-get-x-newest-files-from-a-directory-in-php array foreach scandir folder as node nodePath folder . DIRECTORY_SEPARATOR . node if is_dir nodePath continue images nodePath filemtime..
Accessing session data outside Joomla http://stackoverflow.com/questions/1175598/accessing-session-data-outside-joomla 1 define 'JPATH_BASE' dirname dirname __FILE__ define 'DS' DIRECTORY_SEPARATOR require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php'..
How to get current Joomla user with external PHP script http://stackoverflow.com/questions/2445549/how-to-get-current-joomla-user-with-external-php-script 1 define 'JPATH_BASE' dirname __FILE__ define 'DS' DIRECTORY_SEPARATOR require_once JPATH_BASE .DS.'includes'.DS.'defines.php' require_once..
Delete directory with files in it? http://stackoverflow.com/questions/3349753/delete-directory-with-files-in-it needing to do the recursion yourself dir 'samples' . DIRECTORY_SEPARATOR . 'sampledirtree' it new RecursiveDirectoryIterator dir files..
Replace PHP's realpath() http://stackoverflow.com/questions/4049856/replace-phps-realpath case add cwd if strpos path ' ' false unipath path getcwd .DIRECTORY_SEPARATOR. path resolve path parts single dot double dot and double delimiters.. dot and double delimiters path str_replace array ' ' ' ' DIRECTORY_SEPARATOR path parts array_filter explode DIRECTORY_SEPARATOR path 'strlen'.. ' ' ' DIRECTORY_SEPARATOR path parts array_filter explode DIRECTORY_SEPARATOR path 'strlen' absolutes array foreach parts as part if '.' part..
Preventing Directory Traversal in PHP but allowing paths http://stackoverflow.com/questions/4205141/preventing-directory-traversal-in-php-but-allowing-paths is probably safe. if file_exists dirname __FILE__ . DIRECTORY_SEPARATOR . path Send the file. else Handle the case where the file.. validating input check both and . You can't just check for DIRECTORY_SEPARATOR constant since for example on Windows you can access the file.. example on Windows you can access the file by using but DIRECTORY_SEPARATOR will be . Another warning you SHOULD use dirname __FILE__ ...
Autoload classes from different folders http://stackoverflow.com/questions/5280347/autoload-classes-from-different-folders function __autoload class_name filename str_replace '_' DIRECTORY_SEPARATOR strtolower class_name .'.php' file AP_SITE. filename if file_exists..
How to get a platform independent directory separator in PHP? http://stackoverflow.com/questions/6654157/how-to-get-a-platform-independent-directory-separator-in-php filepath share improve this question Try this one DIRECTORY_SEPARATOR patch somePath. DIRECTORY_SEPARATOR . someFile or you can define.. Try this one DIRECTORY_SEPARATOR patch somePath. DIRECTORY_SEPARATOR . someFile or you can define yours PHP_OS Windows PHP_OS WINNT..
include Jfactory class in an external php file, Joomla http://stackoverflow.com/questions/9459430/include-jfactory-class-in-an-external-php-file-joomla define three constants like define '_JEXEC' 1 define 'DS' DIRECTORY_SEPARATOR define 'JPATH_BASE' _SERVER 'DOCUMENT_ROOT' Then you need to..
Redirect to login page instead of index page in Yii http://stackoverflow.com/questions/9481213/redirect-to-login-page-instead-of-index-page-in-yii config array return array 'basePath' dirname __FILE__ . DIRECTORY_SEPARATOR . '..' 'name' 'My application' 'defaultController' 'myController..
|