clbassett03 Posted July 16, 2013 Share Posted July 16, 2013 Is there any potential problem for putting multiple periods in a filename for PHP. My server is a Linux-based server (running Apache), and I'd like to be able to do something like this: ajax.request.js common.textfunctions.js etc... Quote Link to comment https://forums.phpfreaks.com/topic/280215-multiple-periods-in-file-names/ Share on other sites More sharing options...
AbraCadaver Posted July 16, 2013 Share Posted July 16, 2013 That's fine. I and many projects out there do it all the time. Quote Link to comment https://forums.phpfreaks.com/topic/280215-multiple-periods-in-file-names/#findComment-1440965 Share on other sites More sharing options...
clbassett03 Posted July 16, 2013 Author Share Posted July 16, 2013 So, when the PHP scripting engine, for example, is parsing a filename, does it treat everything after the last period in the filename as the extension? I just wanted to make sure it wasn't the other way around, where it would treat everything after the first period it finds, as the file extension. Again, I'm running on a Linux web server. Quote Link to comment https://forums.phpfreaks.com/topic/280215-multiple-periods-in-file-names/#findComment-1440969 Share on other sites More sharing options...
kicken Posted July 16, 2013 Share Posted July 16, 2013 (edited) PHP doesn't care what the file extension is, it just parses the files content. Your web server software (apache, nginx, iis, etc) is what would (potentially) look at the extension to determine whether the file is a PHP file or not. How multiple extensions are handled will depend on what server software you are using, as well as how it is configured. For example, under some apache configs, somefile.php.jpg would still be recognized as a php file, which can lead to security issues. In general however, so long as whatever you add between the dots doesn't match a common extension that required special processing (ex: php, pl, cgi, etc) then it will likely be ignored. Edited July 16, 2013 by kicken Quote Link to comment https://forums.phpfreaks.com/topic/280215-multiple-periods-in-file-names/#findComment-1440972 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.