Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2001
    Messaggi
    579

    Ricavare il 2o livello di un dominio da un url

    Ho ad esempio il seguente url memorizzato in una variabile "http://forum.html.it/forum/newthread.php?action=newthread&forumid=35&"

    Adesso vorrei in qualche modo ricavarmi dinamicamente il secondo livello del dominio, ovvero "html"...

    Riesco a farlo solo con le request.ServerVariables("SERVER_NAME"), ma non se gli passo un indirizzo tramite una variabile!

  2. #2
    fai uno split dove c'è il .
    Ah, Jedis! I had no ideas! What can i do for you, honored Jedis?

    I'm not Jedi. I'm a guy with a lighsaber and a few questions.

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2001
    Messaggi
    579
    Mi dice:

    Oggetto risposta error 'ASP 0106 : 80020005'

    Tipo non corrispondente

    /prova_2.asp, line 0

    È stato individuato un tipo di dati privo di handle.



    <% dim strURL, strPath
    strURL="http://forum.html.it/forum/newreply.php"
    strPath = Split(strURL, ".")
    response.write strPath %>

  4. #4
    Utente di HTML.it L'avatar di Cream
    Registrato dal
    Feb 2002
    Messaggi
    534
    sbagli a scrivere

    <% strURL = "http://forum.html.it/forum/newreply.php" %>
    <% strPath = Split(mystring, ".") %>
    <% =strPath(0) %>
    <% =strPath(1) %>


    quello con 1 è il secondo livello che ti ricava HTML

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.