Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

[Resolvido] Recuperando Domínio da url

Recommended Posts

<%
Function DominiodaUrl( sText )
'
Dim nIndex
If LCase(Left( sText, 7 )) = "http://" Then
sText = Mid( sText, 8 )
End If
If LCase(Left( sText, 8 )) = "https://" Then
sText = Mid( sText, 9 )
End If
nIndex = InStr( sText, "/")
If nIndex > 0 Then
sText = Left( sText, nIndex - 1 ) 
End If
DomainFromReq = sText
End Function

%>

 

 

Usando a função:

 

DominiodaUrl( "http://www.imasters.com.br/forum/index.php?act=post&do=new_post&f=49") -> www.imasters.com.br

 

DominiodaUrl( "http://www.youtube.com/my_favorites") -> www.youtube.com

 

DominiodaUrl( "www.seu site.net/articles/art1/art1.asp") -> www.seu site.net

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.