Visualizzazione dei risultati da 1 a 9 su 9
  1. #1

    Problema con location.href

    Ciao a tutti! ho il seguente problema: sono in home page del mio sito, c'è 1 tasto kiamato "classifica generale" ke dovrebbe farmi aprire 1 pagina asp kiamata visualizza_classifica.asp; il problema è ke invece d aprirmi quella pagina mi apre la "pre-home" ke rimane 3 secondi aperta e poi in automatico apre la vera home (quella ke dicevo nella prima riga). Il problema è sul location.href xkè se lo metto in 1 altra parte del sito funzia e me la visualizza. come faccio? vi devo postare i codici? CIAO!

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Non credo, ad occhio, che tutto ciò abbia la minima attinenza con ASP.
    Forse il forum scripting è quello più adatto a questa domanda.

    Roby

  3. #3
    dunque, io sto facendo 1 sito in asp x fantacalcio. devo far visualizzare la classifica e nn riesco a far comparire il tasto dove voglio io xkè se lo metto in home page (cioè dove voglio io) quando skiaccio classifica mi rimanda alla home e nn alla classifica. + kiaro ora?

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Ma il tasto non è in un form?

    Roby

  5. #5
    no...xkè deve essere dentro 1 form xkè vada correttamente?

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    No, ma non hai detto come è fatto questo link.

    Robuy

  7. #7
    ah si scusa. ti posto la pagina login.asp ke è la home da cui si può fare il login/registraz. Il bottone c'è già ma come t ho detto nn funge:



    <%
    If Request.QueryString("step") = "2" THEN
    'Rimuovo l'username e la password da caratteri illegali come per esempio '.
    str_username = Replace(Request.Form("username"), "'", "''")
    str_password = Replace(Request.Form("password"), "'", "''")

    Set rs_login = Server.CreateObject ("ADODB.RecordSet")
    strSQL = "SELECT * FROM tbl_authors WHERE name='" & str_username & "' AND pass='" & str_password & "'"
    rs_login.open strSQL,adoCon

    'Se la combinazione username e password non esiste, reindirizzo l'utente ad un altra pagina
    If rs_login.EOF _
    Or rs_login.BOF Then
    Response.Redirect("login_errato.asp")
    Else
    'Scrivo l'user code nel cookie
    Response.Cookies("Login")("userCode") = rs_login("code")
    'Reindirizzo alla pagina appropriata
    If adminEmail = "d.milea@libero.it" AND str_password = "admin" Then
    Response.Redirect("setup.asp?setup=firstTime")
    Else
    Response.redirect("visualizza_profilo.asp")
    End If
    End If
    End if
    %>
    <head>
    <title><%=pageTitle%> .::. Login .::.</title>
    <LINK href="css/file.css" type=text/css rel=stylesheet></head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <body bgcolor="#FFCCCC">
    <center>
    <% If Request.QueryString("disp") = "login" Then %>


    Grazie per esserti registrato, <%=Session("tmpUN")%>! Per loggarti inserisci la password</p>
    <% Else %>


    Se non sei registrato, registrati!</p>
    <% End If %>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="14">
    <tr>
    <td width="100%" height="14">
    <p align="center">[img]images/login.gif[/img]</p>
    </td>
    </tr>
    </table>
    <form action="login.asp?step=2" method="post" onReset="return confirm('Cencello i campi?');">
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="300">
    <tr>
    <td>Username</td>
    <td>
    <input type="text" name="username" size="30" maxlength="80" value="<%If Request.QueryString("disp") = "login" Then Response.Write(Session("tmpUN")) Else Response.Write(str_users_name) End If%>"></td>
    </tr>
    <tr>
    <td colspan="2" height="8"></td>
    </tr>
    <tr>
    <td>Password</td>
    <td><input type="password" name="password" size="30" maxlength="80"></td>
    </tr>
    <tr>
    <td colspan="2" height="8"></td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="center"><input type="submit" value="Login">
    <input type="reset" value="Reset"> </p>
    </td>
    </tr>
    <tr>
    <td colspan="2" height="8"></td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="center">Recupera password
    </BR></p>
    </td>
    </tr>


    <td width="149" height="1"> <input type="button" onclick="location.href='visualizza_classifica.asp' " value="Classifica Generale" name="chart">
    </table>
    </center>
    </div>
    </form>

    </center>

    </BR>

    Regolamento</BR>

    Costi e Premi</BR>

    Credits</BR>

  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Quale sarebbe il bottone?

    Roby

  9. #9
    <td width="149" height="1"> <input type="button" onclick="location.href='visualizza_classifica.asp' " value="Classifica Generale" name="chart">

    questo è il bottone.


    questo pezzo se lo metto nella seguente pagina (visualizza_profilo.asp), mi fa vedere la classifica come voglio!
    Il bottone l'ho già inserito io quindi fai trova e cerki 1 pezzo d codice.





    <%
    Dim isCodeValid
    Dim str_stato, str_name

    'Creo stringa SQL
    validateSQL = "SELECT * FROM tbl_Authors WHERE code='" & str_code & "'"

    'Creo un nuovo recordsheet
    Set rs_validate = Server.CreateObject ("ADODB.RecordSet")

    'Apro il record sheet e eseguo SQL
    rs_validate.open validateSQL,adoCon

    'Se il codice non è valido setto isCodeValid = false
    If rs_validate.EOF _
    Or rs_validate.BOF Then
    isCodeValid = false
    Else
    isCodeValid = true
    End If
    %>

    <title><%=pageTitle%> - <%=str_users_name%></title>
    <body bgcolor="#FFCCCC">

    <% If str_users_stato = "Active" Then %>
    <% If Request.QueryString("mode") = "viewUser" AND isCodeValid = true AND str_users_authority <> "user" AND rs_viewuser("authority") <> "admin" AND str_users_code <> rs_viewuser("code") Then %>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">



    Benvenuto, <%=str_users_name%>!</p>
    <p align="center">:: <%=rs_viewuser("name")%> ::</p>
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="238">
    <tr>
    <td width="200">Username</td>
    <td width="0" height="7"><%=rs_viewuser("name")%></td>
    </tr>
    <tr>
    <td width="200">Nome</td>
    <td width="0" height="11"><%=rs_viewuser("nome")%></td>
    </tr>
    <tr>
    <td width="200">Cognome</td>
    <td width="0" height="11"><%=rs_viewuser("cognome")%></td>
    </tr>
    <tr>
    <td width="200">Password</td>
    <td width="0" height="17">
    <% If str_users_authority = "admin" Then %>
    ')">Visualizza
    <% Else %>
    ...
    <% End If %>
    </td>
    </tr>
    <tr>
    <td width="200">Email</td>
    <td width="0" height="19">"><%=rs_viewuser("email")%></td>
    </tr>
    <tr>
    <td width="200">Città</td>
    <td width="0" height="19"><%=rs_viewuser("citta")%></td>
    </tr>
    <tr>
    <td width="200">Provincia</td>
    <td width="0" height="19"><%=rs_viewuser("provincia")%></td>
    </tr>
    <tr>
    <td width="200">C.A.P</td>
    <td width="0" height="19"><%=rs_viewuser("cap")%></td>
    </tr>
    <tr>
    <td width="200">Tipo di Account</td>
    <td width="0" height="19"><%=rs_viewuser("authority")%></td>
    </tr>
    <tr>
    <td width="200">Data di Registrazione</td>
    <td width="0" height="19"><%=rs_viewuser("dataregistrazione")%></td>
    </tr>
    <tr>
    <td width="200">User Code</td>
    <td width="0" height="19"><%=rs_viewuser("code")%></td>
    </tr>
    <tr>
    <td width="200">Pagina Web</td>
    <td width="0" height="19">
    <% If InSTR(rs_viewuser("pagina_web"), "http://") Then %>
    " target="_blank"><%=rs_viewuser("pagina_web")%>
    <% Else %>
    <%=rs_viewuser("pagina_web")%>
    <% End If %>
    </td>
    </tr>

    <% If rs_viewuser("stato") = "Disabled" Then %>
    <tr>
    <td width="200">Motivo per la disattivazione</td>
    <td width="0" height="19"><%=rs_viewuser("utentesospeso")%></td>
    </tr>
    <% End If %>
    </table>
    </center>
    </div>
    <% If str_users_authority = "admin" Then %>



    <table width="142" height="1" border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse">
    <tr>
    <td width="149" height="1"><input type="button" onclick="location.href='aggiorna_profilo.asp?userC ode=<%=rs_viewuser("code")%>'" value="Aggiorna" name="UpdateProfile"></td>
    <td height="1" width="5"></td>
    <td width="84" height="1"><input type="button" onclick="var doDelete=confirm('Cancellare questo utente?'); if(doDelete) { location.href='cancella_utente.asp?userCode=<%=rs_ viewuser("code")%>' }" value="Cancella" name="Logout"></td>
    <td width="149" height="1"> <input type="button" onclick="location.href='visualizza_squadra.asp?use rCode=<%=rs_viewuser("code")%>'" value="Rosa" name="ViewTeam">
    </td>
    </tr>
    </table>
    <% End If %>
    <% ElseIf str_users_authority = "mod" AND (rs_viewuser("authority") <> "user" AND str_users_code <> rs_viewuser("code")) Then %>



    <center>
    <%=str_users_name%>! _Stai cercando di modificare un utente che ha permessi di amministrazione.
    </center>
    </p>
    <% Else %>
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="191">
    <tr>
    <td width="200">Username</td>
    <td width="0" height="7"><%=str_users_name%></td>
    </tr>
    <tr>
    <td width="200">Nome</td>
    <td width="0" height="11"><%=str_users_nome%></td>
    </tr>
    <tr>
    <td width="200">Cognome</td>
    <td width="0" height="11"><%=str_users_cognome%></td>
    </tr>
    <tr>
    <td width="200">Password</td>
    <td width="0" height="17"> ')">Visualizza</td>
    </tr>
    <tr>
    <td width="200">Email</td>
    <td width="0" height="19"><%=str_users_email%></td>
    </tr>
    <tr>
    <td width="200">Città</td>
    <td width="0" height="19"><%=str_users_citta%></td>
    </tr>
    <tr>
    <td width="200">Provincia</td>
    <td width="0" height="19"><%=str_users_provincia%></td>
    </tr>
    <tr>
    <td width="200">C.A.P.</td>
    <td width="0" height="19"><%=str_users_cap%></td>
    </tr>
    <tr>
    <td width="200">Data di Registrazione</td>
    <td width="0" height="19"><%=str_users_date%></td>
    </tr>
    <tr>
    <td width="200">User Code</td>
    <td width="0" height="19"><%=str_users_code%></td>
    </tr>
    <tr>
    <td width="200">Pagina Web</td>
    <td width="0" height="19">
    <% If InSTR(rs_viewuser("pagina_web"), "http://") Then %>
    " target="_blank"><%=rs_viewuser("pagina_web")%>
    <% Else %>
    <%=rs_viewuser("pagina_web")%>
    <% End If %>
    </td>
    </tr>
    </table>
    </center>
    </div>


    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="1">
    <tr>
    <td height="1"> <input type="button" onclick="location.href='aggiorna_profilo.asp?userC ode=<%=rs_viewuser("code")%>'" value="Aggiorna" name="UpdateProfile"></td>
    <td height="1" width="5"></td>
    <td height="1"> <input type="button" onclick="location.href='logout.asp'" value="Log Out" name="Logout"></td>
    <td height="1" width="5"></td>
    <td width="149" height="1"> <input type="button" onclick="location.href='visualizza_squadra.asp?use rCode=<%=rs_viewuser("code")%>'" value="Rosa" name="ViewTeam"></td>
    <td width="149" height="1"> <input type="button" onclick="location.href='visualizza_classifica.asp' " value="Classifica Generale" name="chart">
    </tr>
    </table>
    <% End If %>
    <% If str_users_authority = "admin" Then %>


    Opzioni di amministrazione:</p>


    Lista degli utenti

    Modifica le impostazioni</p>
    <% ElseIf str_users_authority = "mod" Then %>


    Opzioni moderatore:</p>


    Visualizza la lista degli utenti</p>
    <% End If %>
    <% ElseIf str_users_stato = "Attesa" Then %>
    <p align="center">Il tuo account è in Attesa di conferma.
    Per attivare l'account controllare l'email e clikkare sul link. In caso di problemi contatta il Webmaster.</p>
    <% ElseIf str_users_stato = "Attesa" Then %>
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
    <td colspan="2">
    <p align="center">Il tuo account è stato sospeso. Se pensi che possa
    essere riattivato, contatta il Webmaster.</p></td>
    </tr>
    <tr>
    <td height="8" colspan="2"></td>
    </tr>
    <tr>
    <td colspan="2">
    <p align="center">Ragione per la sospensione:</p></td>
    </tr>
    <tr>
    <td height="8" colspan="2"></td>
    </tr>
    <tr>
    <td width="25%" height="1"></td>
    <td width="75%" height="1">
    <ul>
    <%
    curReason = Split(str_users_utentesospeso, ";")
    i = 0
    For Each reason In curReason
    %>[*]<%=curReason(i)%>
    <%
    i = i + 1
    Next
    %>[/list]
    </td>
    </tr>
    </table>
    </center>
    </div>
    <%
    Else
    Response.Redirect("login.asp")
    End If
    'Close rs_validate
    rs_validate.Close
    %>

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 © 2025 vBulletin Solutions, Inc. All rights reserved.