News Feed
Sections
News Archive


Community Events






feed this:

John Rockefeller's Blog:
PHP Tricks How To Handle Multiple Domains
0 comments :: posted Tuesday May 27, 2008 @ 11:11:01
voice your opinion now!

John Rockefeller has a tip he'd like to share with all of the other PHP developers out there - a little method he's come up with to host multiple domains off of the same code.

This is really handy for those of us who have the same code handling multiple sites or multiple sub-domains. A case in point: When I coded NetBoardz (my free forum hosting service now defunct), I had one codebase handling all 250 forums. How? Simple. When the code runs, it determines which site the user is loading and does different things (like using different databases) dynamically.

He shows the two key points to dividing things up - grabbing the domain and subdomain they were trying to access. This can be fed into a script that can switch things like layout or even functionality based on which site they've chosen.

tagged with: trick multiple domain same codebase subdomain hostname


Stoyan Stefanov's Blog:
www vs no-www and cookies
0 comments :: posted Wednesday May 14, 2008 @ 11:18:39
voice your opinion now!

Stoyan Stefanov has come up against one of the frustrations of web development involving cookies - problems caused by the switch from a "www." in the host to none. He's come up with a test to show you how cookies are set and where you can access them from.

One of the implications of following the rule is related to the whole www vs no-www question. Basically you should always use www if you're planning to use any other sub-domains and you want them cookie-free. This is because you have no way to set a cookie only to the top-level domain.

His code sets cookies for the ".phpied.com", "phpied.com" and "www.phpied.com" domains. Since the domains without the "www" offer a bit broader range of possible matches, he recommends that if you're ever going to use any kind of subdomain, you'll want to use the more broad cookie to cover it.

tagged with: cookie hostname test board coverage


security PEAR framework cakephp database application developer releases conference mysql book pecl release job PHP5 ajax zend zendframework code package

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