Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 6 of 6
  1. #1
    Platinum Lifetime Member

    Join Date
    Dec 2005
    Posts
    70
    DNF$
    520
    Bank
    0
    Total DNF$
    520
    Donate  

    how to strip clean a referring URL

    Hi

    I would like to show the 'domain' part of referring URLs on a web page that I'm working on. In other words - if someone is referred by..

    http://www.dnforum.com/newthread.php...stthread&f=182

    .. then I'd like to just show www.dnforum.com on my page.

    Not sure if this is at all possible, but any help will be much appreciated!

  2. #2
    DNF Member

    Join Date
    Feb 2004
    Location
    Toronto
    Posts
    393
    DNF$
    1,251
    Bank
    0
    Total DNF$
    1,251
    Donate  

    Re: how to strip clean a referring URL

    It can be done with PHP using regular expressions. Basically, you can pregmatch the extensions (.com, .net, .org, etc) and then truncate everything after it.

  3. #3
    www.LOL.biz
    Bender's Avatar
    Join Date
    Apr 2004
    Location
    .ro
    Posts
    1,912
    DNF$
    6,242
    Bank
    0
    Total DNF$
    6,242
    Donate  

    Re: how to strip clean a referring URL


  4. #4
    DNF Member

    Join Date
    Feb 2004
    Location
    Toronto
    Posts
    393
    DNF$
    1,251
    Bank
    0
    Total DNF$
    1,251
    Donate  

    Re: how to strip clean a referring URL

    lol, didn't know there was already a function that does it.

  5. #5
    Platinum Lifetime Member

    Join Date
    Dec 2005
    Posts
    70
    DNF$
    520
    Bank
    0
    Total DNF$
    520
    Donate  

    Re: how to strip clean a referring URL

    Oops, my current Hosting provider doesn't support PHP

    But many thanks for your input, guys. I may have to consider moving my page to another hosting provider.

    Meanwhile, if anyone knows how to go about this with ASP or VBscript, I'd be very greatful for any suggestions

    ---------------
    Added message:

    Just received the following VBSCRIPT suggestion at another forum:

    Dim strURL, tmparray, domain
    strURL = Request.ServerVariables("HTTP_REFERER")
    tmparray = Split(strURL, "/")
    domain = tmparray(2)

    This seems to work fine, so I will use this for the time being.

    Thanks again for the PHP ideas. I will certainly document them for future reference!
    Last edited by Dutch; 12-18-2006 at 07:20 AM. Reason: Automerged Doublepost

  6. #6
    DNF Member

    Join Date
    Feb 2004
    Location
    Toronto
    Posts
    393
    DNF$
    1,251
    Bank
    0
    Total DNF$
    1,251
    Donate  

    Re: how to strip clean a referring URL

    It can be done with almost all serverside languages.

Similar Threads

  1. Manual URL submission service
    By xman in forum Advertising and Related Offers
    Replies: 3
    Last Post: 07-09-2007, 03:22 AM
  2. I goofed up with url submiting now what to do
    By tas38 in forum Gold Cafe
    Replies: 2
    Last Post: 05-25-2006, 06:59 PM
  3. Fancy URL Redirection Website
    By .com.net.org in forum Developed Websites for Sale
    Replies: 6
    Last Post: 12-27-2004, 01:15 AM
  4. Image Hosting System and URL Redirect System
    By PolarDomains in forum Advertising and Related Offers
    Replies: 0
    Last Post: 10-25-2004, 04:17 PM

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
  •  

Domain name forum recommended by Domaining.com