News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Protect files within public folders with mod_rewrite and PHP
November 29, 2010 @ 09:45:43

Gonzalo Ayuso has a new post that can help you protect certain files inside of a public folder by combining mod_rewrite and PHP.

Here's the problem. We have a legacy application (or a WordPress blog for the example) and we want to protect the access to the application according to our corporate single sign on. We can create a plug-in in WordPress to ensure only our single sign-on's session cookie is activated.

In his example, he shows the handling of an uploaded file and a plugin that can be used to protect parts of the site based on session information. Unfortunately, by itself, this doesn't prevent the direct access of the file. His trick is to route all file access back through a central "media.php" script that fetches it from a file location (could even be outside the docroot). The routing to the PHP is handled via mod_rewrite and the code checks the permissions on the current user's session for access.

0 comments voice your opinion now!
modrewrite public folder tutorial protect file wordpress


NETTUTS.com:
Scanning Folders with PHP
November 13, 2008 @ 14:18:28

The NETTUTS.com site has posted a new PHP-related screencast that covers a simple script to scan over the contents of folders in PHP. To illustrate, they create an image gallery script that mirrors the filesystem structure.

Let's imagine that you want to build a page that will display snapshots of your latest work. [...] In such instances, the best solution is to make PHP scan your "portfolio" folder and dynamically create the code for you. If you want to update your page with a new snapshot, all that you need to do is drag the image, and its respective thumbnail, into the appropriate folders - and PHP will do the rest. Let's build it now!

The screencast comes complete with the entire source and a link to a demo to show the end result.

0 comments voice your opinion now!
scan folder filesystem directory tutorial photo gallery screencast


Ed Finkler's Blog:
Zend Studio for Eclipse and SFTPDrive not on speaking terms
March 20, 2008 @ 07:58:09

Ed Finkler, a long-time user of SFTPDrive on his Windows machine, has noticed something a bit odd lately when using the new Zend Studio (Eclipse):

For some reason, ZSfE just doesn't show me my 'k:' drive (the SFTP mount) when browsing for a project directory. This throws a real wrench in my usual workflow '" ZS 5.5 had built-in SFTP support, and I could also use the local mount if I wanted.

Finding nothing in the traditional places, he's made this blog post hoping someone might have the answer. Turns out that the fix (as provided by Josh Johnston) is to create a new project around a new Remote Folder.

0 comments voice your opinion now!
eclipse zendstudio sftpdrive remote folder edit drive


Web Development Blog:
Tutorial Create a zip file from folders on the fly
September 28, 2007 @ 10:24:00

On the Web Development Blog, there's a quick tutorial on creating dynamic zip files via a helpful little class:

For a future project I needed these days some easy to use zip or gzip class to create a zip file from files / folders inside a specified directory. [...] I tested two [other] scripts before and must say that this script works great for single files if you add them manually. To compress a whole directory with an unknown number of files into one zip file I created some class extension to get this job done.

In his class, the get_file_from_folder method is called with the directory and the file to load them into. This loops through the files, pulling them all (directories and all) into the new zip file. An example of the class' use is also included.

0 comments voice your opinion now!
zip file folder directory automatic class example zip file folder directory automatic class example


Alexander Netkachev's Blog:
How to use Zend Framework Controller/Action approach?
February 08, 2007 @ 09:57:00

Continuing on from an earlier discussion about the Zend Framework and form submission and handling, Alexander Netkachev has come back to talk a bit more about the Controller/Action approach.

I have a few discussions here about the question I opened a couple of days ago: how the standard form processing is related to the Controller/Action idea and how developers that are creating sites with the standard Folder/Page approach can use Zend Framework's Controller/Action approach.

What came out of the discussions were three points - use the Controller/Action model to your advantage, use your own forms but use RewriteRouter to make them work, or use the Folder/Page mentality instead.

0 comments voice your opinion now!
zendframework controller action folder page rewriterouter zendframework controller action folder page rewriterouter



Community Events





Don't see your event here?
Let us know!


framework code developer introduction language configure list install opinion refactor interview series unittest community testing podcast release wordpress threedevsandamaybe laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework