(PHP) Navigation öffnet Seite in neuem Fenster statt im frame
Dogfish
- javascript
Hallo ihr da draußen,
<?php $link = file("links"); for($i = 0; $i < count($link); $i = $i + 2) { $linktitel[count($linktitel)] = str_replace("\n","",$link[$i]); $linkpfad[count($linkpfad)] = str_replace("\n","",$link[$i+1]); } $countername = "temp"; $titel = "navigate"; if($QUERY_STRING == "") { $QUERY_STRING = 0; } $zusatz = " <script language = "JavaScript" type = "text/javascript"><!-- parent.frames[1].window.location.href = "../".urldecode($linkpfad[$QUERY_STRING]).""; //--></script>"; $zusatz.=" <style type = "text/css"> td { background: url(../navigate/Grafiken/button.png); } td:hover { background: url(../navigate/Grafiken/button_over.png); } </style> "; require("../all/head.php"); ?> <body> <font size = "+1"> <table border = "0"> <?php for ($i=0;$i<$QUERY_STRING;$i++) { ?> <tr> <td height = "48" width = "195"> <center> <a class = "green" name = "<?=$linktitel[$i]?>" href = "index.php?<?=$i?>" onmouseover = "hover('<?=$linktitel[$i]?>');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "<?=$linktitel[$i]?>"> <?php print "\t\t\t\t\t\t\t\t{$linktitel[$i]}\n"; ?> </a> </center> </td> </tr> <?php } ?> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <?php print "\t\t\t\t\t\t\t\t{$linktitel[$i]}\n"; ?> </center> </td> </tr> <?php $i++; for ($i;$i<count($linkpfad);$i++) { ?> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "<?=$linktitel[$i]?>" href = "index.php?<?=$i?>" onmouseover = "hover('<?=$linktitel[$i]?>');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "<?=$linktitel[$i]?>"> <?php print "\t\t\t\t\t\t\t\t{$linktitel[$i]}\n"; ?> </a> </center> </td> </tr> <?php } ?> </table> </font> </body> </html>
Das ist jetzt vielleicht ein wenig unübersichtlich. Erklärungen: Ich habe eine Datei namens links, in der stehen alle links drinnen. Noch eine Datei namens ../all/head.php, in der stehen alle Header-Informationen drin. Wenn ich die Seite mit QUERY_STRING = 0 öffne, sieht der HTML-Kot so aus:
<!-- /* --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> navigate Copyright © 2002 by Candid Dauth </title> <link rel = "shortcut icon" href = "../all/../favicon.ico" type = "text/ico"> <script language = "JavaScript" type = "text/javascript" src = "../all/Hover.php"> </script> <script language = "JavaScript" type = "text/javascript"> <!-- if(parent.text.window.location.href == "http://candid.localnet/navigate/") { parent.bottom.window.location.href = "../all/../unten/index.php?titel=navigate&adresse=/navigate/index.php"; } //--> </script>
<script language = "JavaScript" type = "text/javascript"><!-- parent.frames[1].window.location.href = "../welcome"; //--></script> <style type = "text/css"> td { background: url(../navigate/Grafiken/button.png); } td:hover { background: url(../navigate/Grafiken/button_over.png); } </style>
<style type = "text/css"> <!-- / //--> @font-face { font-family: helv,helvetica,arial,sans-serif; src: url(../Sonstige/bnhrdmob.ttf); } font.Massstab { font-family: helv,helvetica,arial,sans-serif; color: #0000FF; } body { scrollbar-track-color: #FFFFC0; scrollbar-shadow-color: #FFFFC0; scrollbar-highlight-color: #FFFFC0; scrollbar-darkshadow-color: #FFFFC0; scrollbar-3d-light-color: #000000; background-attachment: fixed; scrollbar-face-color: #000064; margin-left: 5px; color: black; background: #FFFFC0; font-family: helv,helvetica,arial,sans-serif; scrollbar-arrow-color: #FFFFC0; scrollbar-base-color: #FFFFC0; cursor: url(../all/Grafiken/Cursor.png); } body.leiste1 { color: #FFFF00; background: url(../oben/Grafiken/bg1.png); cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } body.leiste2 { color: #FFFF00; background: url(../unten/Grafiken/bg2.png); cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } body.bgcolor { scrollbar-track-color: #FFFFC0; scrollbar-shadow-color: #FFFFC0; scrollbar-highlight-color: #FFFFC0; scrollbar-darkshadow-color: #FFFFC0; scrollbar-3d-light-color: #000000; background-attachment: fixed; scrollbar-face-color: #000064; margin-left: 5px; color: black; font-family: helv,helvetica,arial,sans-serif; scrollbar-arrow-color: #FFFFC0; scrollbar-base-color: #FFFFC0; cursor: url(../all/Grafiken/Cursor.png); } a { color: #FF0000; text-decoration: none; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } a.l { color: #FF0000; text-decoration: none; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } a.green { color: #00FF00; text-decoration: none; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } a.darkgreen { color: green; text-decoration: none; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } a:hover { color: #9080FF; text-decoration: underline overline blink; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } img { color: #000000; cursor: url(../all/Grafiken/no.gif); border: none; } textarea { color: #000000; background: #FFFFC0; font-family: helv,helvetica,arial,sans-serif; cursor: url(../all/Grafiken/Cursor.png); } /***************************************************************************************/
Fortsetzung in der Antwort...
Fortsetzung in der Antwort...
Dies ist die Fortsetzung(Zeug war zuviel)
input { color: #000000; background: #FFFFC0; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } input.button { color: #000000; background: #FFFFC0; // border-color: #FFFFFF; font-family: helv,helvetica,arial,sans-serif; cursor: url(../all/Grafiken/help.gif); } input.hilfe { color: #000000; background: #FFFFC0; cursor: url(../all/Grafiken/help.gif); font-family: helv,helvetica,arial,sans-serif; } input.radio { color: #000000; background: #FFFFC0; font-family: helv,helvetica,arial,sans-serif; } select { color: #000000; background: #FFFFC0; cursor: url(../all/Grafiken/Cursor.png); font-family: helv,helvetica,arial,sans-serif; } /* ************************************************************************************* / / The following stylesheets make that the h*s have the same size in all browsers / /h1 { font-size: 43px; font-weight: bold; } h2 { font-size: 32px; font-weight: bold; h3 { font-size: 24px; font-weight: bold; } h4 { font-size: 21px; font-weight: bold; } h5 { font-size: 19px; font-weight: bold; } h6 { font-size: 16px; font-weight: bold; }/ code { color: #505050; } /<!--
--> </style> <body> <font size = "+1"> <table border = "0"> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> Willkommen! </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "News" href = "index.php?1" onmouseover = "hover('News');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "News"> News </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Chat" href = "index.php?2" onmouseover = "hover('Chat');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Chat"> Chat </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Über mich" href = "index.php?3" onmouseover = "hover('Über mich');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Über mich"> Über mich </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Links" href = "index.php?4" onmouseover = "hover('Links');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Links"> Links </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Grafiken" href = "index.php?5" onmouseover = "hover('Grafiken');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Grafiken"> Grafiken </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Kontaktformular" href = "index.php?6" onmouseover = "hover('Kontaktformular');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Kontaktformular"> Kontaktformular </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Endlosgeschichte" href = "index.php?7" onmouseover = "hover('Endlosgeschichte');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Endlosgeschichte"> Endlosgeschichte </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Witze" href = "index.php?8" onmouseover = "hover('Witze');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Witze"> Witze </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Meine Klasse" href = "index.php?9" onmouseover = "hover('Meine Klasse');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Meine Klasse"> Meine Klasse </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Zuspätkommstorys" href = "index.php?10" onmouseover = "hover('Zuspätkommstorys');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Zuspätkommstorys"> Zuspätkommstorys </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Gästebuch" href = "index.php?11" onmouseover = "hover('Gästebuch');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Gästebuch"> Gästebuch </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Midis" href = "index.php?12" onmouseover = "hover('Midis');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Midis"> Midis </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Quälkots" href = "index.php?13" onmouseover = "hover('Quälkots');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Quälkots"> Quälkots </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Copyright" href = "index.php?14" onmouseover = "hover('Copyright');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Copyright"> Copyright </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Tipps & Tricks" href = "index.php?15" onmouseover = "hover('Tipps & Tricks');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Tipps & Tricks"> Tipps & Tricks </a> </center> </td> </tr> <tr> <td onmouseover = "this.style.background = 'Grafiken/button_over.png';" height = "48" width = "195"> <center> <a class = "green" name = "Umfragen" href = "index.php?16" onmouseover = "hover('Umfragen');" onmouseout = "unhover();" onClick = "Status = newStatus" title = "Umfragen"> Umfragen </a> </center> </td> </tr> </table> </font> </body> </html>
Soweit alles Okay. Nun tritt das Problem auf: Wenn ich den Link Grafiken öffne, und dann zweimal einen Link, der über dem Link Grafiken ist öffne, wird jeder Link in einem neuen Fenster geöffnet, und nicht im Frame. Woran kann das liegen? Der Fehler lässt sich übrigens reproduzieren, und zwar in den Browsern Konqueror, Mozilla, Opera, die anderen hab ich noch nicht getestet.
Kann mir jemand helfen?
Danke schon mal im Vorraus,
Grüße von hier drinnen,
Dogfish
Hallo,
willst du uns mit Quelltext erschlagen?
Konzentriere das, das nächste mal bitte auf das wesentliche!
Ich habe mir nicht die MÜhe gemacht alles durchzugehen.
Wenn deine Links in einem neuen Fenster geöffnet werden, stimmt was mit dem target nicht. Prüfe doch bitte mal, ob da der Korrekte Framename drin steht.
Gruß
ueps
Hallo du da draußen,
willst du uns mit Quelltext erschlagen?
Nein, ich dachte nur, es könnte vielleicht manche interessieren.
Konzentriere das, das nächste mal bitte auf das wesentliche!
Okay,
<script language = "JavaScript" type = "text/javascript"><!--
parent.frames[1].window.location.href = "../welcome";
//--></script>
Das ist das Problem.
Grüße von hier drinnen,
Dogfish
Hallo du da draußen,
Hi du da drinnen
<script language = "JavaScript" type = "text/javascript"><!--
parent.frames[1].window.location.href = "../welcome";
//--></script>
Das ist das Problem.
Ich denke da haben wir den Fehler schon:
parent.frames[1] ist schon das window Objekt, du
machst dhinter nochmal ein window und so ist das ganze doppelt, was
wahrscheinlich ein neues Fenster aufmacht.
Probier mal: prent.frames[1].location.href = ...
Gruß
ueps
Hallo du da draußen,
Funktioniert aber immernoch nicht.
Grüße von hier drinnen,
Dogfish
hi,
Funktioniert aber immernoch nicht.
'top.frames[1].location.href' weist dem _zweiten_ Frame eine URL zu. Besser Namen fuer frame vergeben, dann: 'top.FRAMENAME.location.href'.
Gruss Joachim
Hi,
'top.frames[1].location.href' weist dem _zweiten_ Frame eine URL zu. Besser Namen fuer frame vergeben, dann: 'top.FRAMENAME.location.href'.
Ja, aber das ist hier egal, er kann auch parent nehmen, so viele Frames sind es ja nicht.
Könntest du mir mal den Quelltext der Ausgabe Datei zeigen, die php erzeugt hat? Das würde glaube ich mehr bringen als der PHP Code.
ueps
Hallo du da draußen,
Das ist eine Stelle aus der Ausgabe-Datei. Die ganze habe ich ja am Anfang geschrieben, das waren ganze zwei Forums-Einträge.
parent.text bzw top.text (Mein Frame heißt text)
hat beides nichts geholfen.
Grüße von hier drinnen,
Dogfish
Hi nochmal,
also rein vom Prinzip her dürfte eigentlich kein neus Fenster aufgehen. Ist die Seite irgendwo in Aktion zu sehn?
ueps
hi,
Ja, aber das ist hier egal, er kann auch parent nehmen, so viele Frames sind es ja nicht.
mit top bist Du ganz oben in der Hirarchie, parent ist lediglich das nächst höhere Element. Kann gleich sein - muss aber nicht, hab den Quelltext nicht gelesen.
Gruss Joachim