Avatar billede iceb1977 Nybegynder
08. januar 2003 - 10:37 Der er 13 kommentarer og
1 løsning

Luk vindue og redirect ???????

Hej Eksperter

Jeg har et parrant vindue som åbner et child

vindue. Derefter vil jeg gerne have et link

på child vinduet der:

1. lukker child vinduet

2. redirecter parrent vinduet

Link til admin:

http://iceb.dk/chat/l1977.asp

HUSK at klikke ind på admin linket........

Kode til admin.asp:

<!-- #include file="simpelchat.inc.asp" -->
<%
Response.Buffer = True

Mode = Request("mode")

If Mode = "" Then
End If

If Mode = "login" Then
%>
<html>

<head>
<title><%= ChatTitle %></title>
</head>

<frameset framespacing="1" border="0" frameborder="0" rows="25,*">
  <frame src="admin.asp?mode=admin_header" marginwidth="25" marginheight="0" scrolling="no" noresize>
  <frame src="admin.asp?mode=admin_login" marginwidth="20" marginheight="20" scrolling="auto" noresize>
  <noframes>
  <body>

  </body>
  </noframes>
</frameset>

</html>
<%
End If

If Mode = "admin_header" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor1 %>" text="<%= TextColor1 %>" link="<%= LinkColor1 %>" alink="<%= LinkColor1 %>" vlink="<%= LinkColor1 %>">

<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="middle" align="left"><b>Administrator funktioner</b></td>
  </tr>
</table>

</body>

</html>
<%
End If

If Mode = "admin_login" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
<script language="JavaScript">
<!--

function CheckLogin() {
if (document.adminFrm.password.value == "") {document.adminFrm.password.focus();return false;}
}

// -->
</script>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>" onload="java script:adminFrm.password.focus();">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Beskyttet område</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left">Skriv din adgangskode i boksen nedenfor.</td>
  </tr>
  <tr>
    <td valign="top" align="left">
      <table border="0" cellspacing="0" cellpadding="5">
        <form method="POST" action="admin.asp" name="adminFrm" onsubmit="java script:return CheckLogin();">
        <input type="hidden" name="mode" value="activate">
        <tr>
          <td valign="middle" align="left"><input type="password" name="password" size="15" maxlength="10" style="font-family: Verdana; font-size: 8 pt"></td>
          <td valign="middle" align="left"><input type="submit" value="Login" style="font-family: Verdana; font-size: 8 pt"></td>
        </tr>
        </form>
      </table>

<p align="right">
<a href="java script:open.location.replace('http://jubii.dk/');">Luk</a>


</body>

</html>
<%
End If

If Mode = "activate" Then
    If Request("password") = AdminPassword Then
        Response.Redirect "admin.asp?mode=activated&password=" & Request("password")
    Else
        Response.Redirect "admin.asp?mode=admin_login"
    End If
End If

If Mode = "activated" Then
    If Request("password") = AdminPassword Then
        If Request("action") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Hovedmenu</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser">Slet
      bruger</a> - <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeallusers">Slet
      alle brugere</a> - <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=resetmessages">Nustil
      beskeder</a></td>
  </tr>
</table>

<br><br>
<p align="right">
<a href="java script:top.window.close()">Luk dette vindue</a>

</body>

</html>
<%
        End If
        If Request("action") = "removeuser" Then
            If Request("userid") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Slet bruger</u></b></td>
  </tr>
  <%
If Application("chatusers") = 1 Then
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Tilbage</a></td>
  </tr>
  <%
Else
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <%
End If
  %>
  <tr>
    <td valign="top" align="left">
      <table border="0" cellspacing="0" cellpadding="5">
        <%
If Application("chatusers") = 1 Then
        %>
        <tr>
          <td valign="top" align="left">Der er ingen aktive brugere i chatten.</td>
        </tr>
        <%
    Else
    For x = 1 To Application("chatusers")
        If Application("chatuser_" & x) <> Session("chatname") Then
        %>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser&amp;userid=<%= x %>">Slet</a></td>
          <td valign="top" align="left"><font color="#00FF00"><b><% Response.Write Application("chatuser_" & x) %></b></font></td>
        </tr>
        <%
        End If
    Next
End If
        %>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
            Else
                If Request("confirm") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Slet bruger</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <tr>
    <td valign="top" align="left">
      <table border="0" width="100%" cellspacing="0" cellpadding="5">
        <tr>
          <td valign="top" align="left">Slet <font color="#00FF00"><b><%= Application("chatuser_" & Request("userid")) %></b></font>
            fra den aktive brugerliste?</td>
        </tr>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser&amp;userid=<%= Request("userid") %>&amp;confirm=yes">Ja</a>
            / <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser">Nej</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
                Else
                    For x = MaxPublicMessages To 2 Step -1
                        Application("publicmessage_" & x) = Application("publicmessage_" & x-1)
                    Next
                    Application("publicmessage_1") = "<b><font color='" & SystemColor & "'>Chatten : Admin har smidt " & Application("chatuser_" & Request("userid")) & " af chatten...</font></b>"
                    Application("chatusers") = Application("chatusers") - 1
                    Application("chatuser_" & Request("userid")) = ""
                    Response.Redirect "admin.asp?mode=activated&password=" & Request("password") & "&action=removeuser"
                End If
            End If
        End If
        If Request("action") = "removeallusers" Then
            If Request("confirm") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Slet alle brugere</u></b></td>
  </tr>
  <%
If Application("chatusers") = 1 Then
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Tilbage</a></td>
  </tr>
  <%
Else
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <%
End If
  %>
  <tr>
    <td valign="top" align="left">
      <table border="0" width="100%" cellspacing="0" cellpadding="5">
        <%
If Application("chatusers") = 1 Then
        %>
        <tr>
          <td valign="top" align="left">Der er ingen aktive brugere i chatten.</td>
        </tr>
        <%
    Else
        %>
        <tr>
          <td valign="top" align="left">Slet alle brugere fra den aktive brugerliste?</td>
        </tr>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeallusers&amp;confirm=yes">Ja</a>
            / <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Nej</a></td>
        </tr>
        <%
End If
        %>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
            Else
                For x = MaxPublicMessages To 2 Step -1
                    Application("publicmessage_" & x) = Application("publicmessage_" & x-1)
                Next
                Application("publicmessage_1") = "<b><font color='" & SystemColor & "'>Chatten : Admin har smidt alle brugere af chatten...</font></b>"
                For x = 1 To Application("chatusers")
                    If Application("chatuser_" & x) <> Session("chatname") Then
                        Application("chatusers") = Application("chatusers") - 1
                        Application("chatuser_" & x) = ""
                    End If
                Next
                Response.Redirect "admin.asp?mode=activated&password=" & Request("password")
            End If
        End If
        If Request("action") = "resetmessages" Then
            If Request("confirm") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Nulstil beskeder</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <tr>
    <td valign="top" align="left">
      <table border="0" width="100%" cellspacing="0" cellpadding="5">
        <tr>
          <td valign="top" align="left">Nulstil beskederne i chatten?</td>
        </tr>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=resetmessages&amp;confirm=yes">Ja</a>
            / <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Nej</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
            Else
                For x = 1 to MaxPublicMessages
                    Application("publicmessage_" & x) = ""
                Next
                Application("publicmessage_1") = "<b><font color='" & SystemColor & "'>Chatten : Admin har nulstillet chatten...</font></b>"
                Response.Redirect "admin.asp?mode=activated&password=" & Request("password")
            End If
        End If
    Else
        Response.Redirect "admin.asp?mode=admin_login"
    End If
End If
%>
Avatar billede thomas_yde Nybegynder
08. januar 2003 - 11:02 #1
DU skal i child lave :
<a href="void(0)" onclick="self.close();">luk</a>

redirect fra child:
opener.location.href= "et eller andet"
Avatar billede thomas_yde Nybegynder
08. januar 2003 - 11:03 #2
Skriv hvis du kan bruge det til noget
Avatar billede iceb1977 Nybegynder
08. januar 2003 - 12:12 #3
nej du kan ikke skrive de to linier sepearat kig ind på siden

det virker ikke .........

de skal stå i samme lunk sådan her

<a href=" lukke script - redirection script">luk </a>
Avatar billede thomas_yde Nybegynder
08. januar 2003 - 12:35 #4
Du kan ikke lukke vinduet og redirecte med js bagefter.
Du kan redirecte og lukke. Det er ihvertfald hvad min logik siger mig :)

<a href="void(0)" onclick="opener.location.href='http://www.ofir.dk';self.close()">luk</a>
Avatar billede iceb1977 Nybegynder
08. januar 2003 - 12:47 #5
ok to fejl

1. the page cannot be found

2. den lukker kun noget af vinduet og ikke HELE vinduet.....

Hvordan kan det være ?
Avatar billede iceb1977 Nybegynder
08. januar 2003 - 12:52 #6
den prøver at åbne

http://iceb.dk/chat/void(0)

og får så

404 fejl ...........
Avatar billede iceb1977 Nybegynder
08. januar 2003 - 13:00 #7
se nu virker det child vinduet lukker bare ikke og der

redirectes i child vinduet i stedet for i parrant vinduet

hvordan kan det være ?
Avatar billede Slettet bruger
08. januar 2003 - 16:09 #8
Det kan være fordi child-vinduet består af frames. I så fald skal det være:

<a href="#" onClick="top.opener.location.href = 'din_side.html'; top.close(); return false;">Bla</a>
Avatar billede iceb1977 Nybegynder
08. januar 2003 - 17:17 #9
ahhh det er fordi man skriver top når man vil

kontakte parrent vinduet fra child vinduet .....

Nå men det virker nu så mange tak
Avatar billede iceb1977 Nybegynder
08. januar 2003 - 17:18 #10
phoe> hvis du ikke lægger et SVAR så får thomas

pointene......... ???
Avatar billede Slettet bruger
10. januar 2003 - 16:50 #11
Svar
Avatar billede thomas_yde Nybegynder
10. januar 2003 - 22:54 #12
jamen tak...
Avatar billede Slettet bruger
11. januar 2003 - 10:08 #13
thomas_yde>> Vil du have halvdelen? Bare sig til!
Avatar billede thomas_yde Nybegynder
15. januar 2003 - 23:51 #14
nej det er lige meget phoenixv, det er bare ikke sådan en gut man har lyst til at hjælpe igen...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester