| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jan 2004
Posts: 248
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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.namepros.com/newthread.php?do=newthread&f=46 .. then I'd like to just show www.namepros.com on my page. Not sure if this is at all possible, but any help will be much appreciated! |
| |
| | #2 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | PHP Code: |
| |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Jan 2004
Posts: 248
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Many thanks for the info, Dan! I actually forgot to mention that my current hosting provider doesn't support PHP, but I may have to consider moving to one that does.Meanwhile, would you by any chance now how to accomplish this with ASP/vbscript? --------------- Added message: Just received the following script 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!
Last edited by Dutch; 12-18-2006 at 06:16 AM.
|
| |