Re: [PHP] check if website has www. in front of domain

2008-02-16 Thread Christoph
// Check if site is preceeded by 'WWW' public function checkWWW() { $myDomain = $_SERVER['SERVER_NAME']; $FindWWW = '.'; $POS = strpos($myDomain, $FindWWW); if ($POS === false) { return false; } else { return true;

Re: [PHP] check if website has www. in front of domain

2008-02-16 Thread Richard Heyes
// Check if site is preceeded by 'WWW' public function checkWWW() { $myDomain = $_SERVER['SERVER_NAME']; $FindWWW = '.'; $POS = strpos($myDomain, $FindWWW); if ($POS === false) { return false; } else { return true;

Re: [PHP] check if website has www. in front of domain

2008-02-15 Thread Daniel Brown
On Fri, Feb 15, 2008 at 3:55 PM, nihilism machine <[EMAIL PROTECTED]> wrote: > Still doing the old behavior (www.www.domain.com) This code works. You can see it in action at http://www.pilotpig.net/code-library/checkwww.php and see the source at http://www.pilotpig.net/code-library/source.php

Re: [PHP] check if website has www. in front of domain

2008-02-15 Thread Daniel Brown
Please don't start a new thread for every time you change a bit of your code. It messes up the archives and fills people's inboxes. In any case, change the following two functions as shown. You were setting $this->WWW to False (with only one = operator), and you should also use $_SERVER[

Re: [PHP] check if website has www. in front of domain

2008-02-15 Thread Daniel Brown
On Fri, Feb 15, 2008 at 3:18 PM, nihilism machine <[EMAIL PROTECTED]> wrote: > here is my function: > > // Check if site is preceeded by 'WWW' > public function checkWWW() { > $myDomain = $_SERVER['SERVER_NAME']; > $FindWWW = '.'; >

[PHP] check if website has www. in front of domain

2008-02-15 Thread nihilism machine
here is my function: // Check if site is preceeded by 'WWW' public function checkWWW() { $myDomain = $_SERVER['SERVER_NAME']; $FindWWW = '.'; $POS = strpos($myDomain, $FindWWW); if ($POS === false) {