SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member Bane's Avatar
    Join Date
    Feb 2001
    Location
    Los Angeles, USA
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Domain Seperation

    I was wondering if someone can help me. Im working on a little script right now and I have the following:
    Code:
    $tl_site="talkloud.net";
    $tlurl = parse_url($GLOBALS[HTTP_REFERER]);
    
    if ($tlurl[host] and !eregi($tlurl[host], $GLOBALS[HTTP_HOST]) and $tlurl[host] != '$tl_site' and $tlurl[host] != 
    'www.$tl_site') {
    What I was wondering is if there is a way, instead of this to check a setting to see if a site is in the list.

    In other words, now $tl_site="talkloud.net" I would like it to be $tl_site="talkloud.net,hotmail.com,etc.com" and have it check to make sure that none of those domain names are on the list.

    Also is their an easier way to check to see if it has the www.?

  2. #2
    SitePoint Enthusiast vsantola's Avatar
    Join Date
    Jan 2001
    Location
    Portugal
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to check if the domain starts with www use the substr() function...
    Valter Santos

    rooco is my creature (a mix of a bear with a kanguroo)... he is trained in perl, PHP and is getting a java certification right now

  3. #3
    SitePoint Member Bane's Avatar
    Join Date
    Feb 2001
    Location
    Los Angeles, USA
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The point of this is to make sure that any site in the tl_site var isn't put into the database. But I'm not sure how to make it so that it will work with multiple sites. The way I've done it now it will only check one

    Also how would I stop normal ip addresses (like the 64.xxx.xx.xxx hotmail always has) from being entered as well?

  4. #4
    SitePoint Zealot
    Join Date
    May 2001
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could put the domains in an array and use a for-each loop to check that each of the domains that way.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •