WebWork Magazin - Webseiten erstellen lassen, Online Medien, html

Webhoster, Webhosting Provider und Domain registrieren

Home | Registrieren | Einloggen | Suchen | Aktuelles | GSL-Webservice | Suleitec Webhosting
Reparatur-Forum | Elektro forum | Ersatzteilshop Haushalt und Elektronik


Homepage und Webhosting-Forum

Scripte und Programme für PHP, MYSQL. Diskussionen zur Programmierung im Web. Fragen zu CMS, Blogsoftware, Shops, Newsletter und vielen weiteren Scripten.


Forum » PHP & MySQL » Navigation mit Frames » Antworten
Benutzername:
Passwort: Passwort vergessen?
Inhalt der Nachricht: Fett | Kursiv | Unterstrichen | Link | Bild | Smiley | Zitat | Zentriert | Quellcode| Kleiner Text
Optionen: Emailbenachrichtigung bei Antworten
 

Die letzten 5 Postings in diesem Thema » Alle anzeigen
von brali
hallo,
also die Lösung ist eigentlich doch ganz einfach. Bin selber druff gekommen.

Also anstatt break; benutzt man einfach den befehl exit();
somit ist die anweisung mit Link(klick) unterbrochen und es wird kein weiter
text und menüe(dingsdumbs) angebwiesen.

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20:
[center]<?php

switch($_GET['page']){

   case '1':
      include('main.php');
      exit();
   
   case '2':
      include('uns.php');
      exit();
  
   case '3':  
      include('wws.php');
      exit();

   default:
      include('blue.htm');

} ?>[/center]



trotzdem danke an alle..

von HG
Ganz einfach:

Die menue.php zeigt in der derzeitigen Form immer die Navigation an. Sie ist ja fest in den HTML-Code integriert.

Wenn diese Datei nun also im linken Frame angezeigt wird, führt die switch-Anweisung zu keinem Ergebnis. Es wird also einfach der HTML-Code angezeigt.

Im Content-Frame ist das ein wenig anders: Hier führt die switch-Anweisung zu einem Ergebnis, und lädt also die entsprechende Seite. Aber dadurch, daß nun der restliche HTML-Code an den Browser gesandt wird, wird natürlich auch die Navigation wieder angezeigt.

Deswegen musst du entweder einen weiteren Navigationsparameter nageben, so daß die beiden Teile deiner Seite sich gegenseitig "ausschalten", oder aber du machst eine zweite Datei, die nur den Content ausgibt, und dann nur den Content ausgibt.
von brali
HG schrieb am 31.08.2003 22:33
Jetzt ist alles klar: Die Navigation wird ja immer als HTML ausgegeben. Du kannst entweder (wie ich schon geschrieben habe) die Datei in zwei Dateien auftrennen, oder aber:

Du übergibst eine weitere Variable, die steuert, welcher Teil sichtbar sein soll.
z.B. menue.php?navi=1, dann gibst du nur die Navigation aus, indem du die beiden Teile in unterschiedliche if' - Konstruktionen haust:
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10:
if ( 1 == $_GET['navi']) {
   // Die Navigation ausgeben, wie jetzt auch...
} else {
   // Nun muss der Inhalt ausgeben werden, also:
   switch ($_GET['page'] {
      // hier die cases
   }
}


Ich würde die Datei aber auftrennen.



Sorry, aber so komme ich echt nicht klar, mir fehlt dafür wohl gerade das verständniss.
Warum muss ich die Navi mit einbauen?

Ich möchte doch lediglich das die Links die oben im Case stehen im rechten frame angezeigt werden. Die Navi ist dch eh da, da es ein Frame ist und feststeht.

Warum sollte ich dann (nur zum besseren verständniss) die weiteren codes wie du sagst mit einbauen?

Wie gesagt kommt momentan nicht an im Kopf :o)
von HG
Jetzt ist alles klar: Die Navigation wird ja immer als HTML ausgegeben. Du kannst entweder (wie ich schon geschrieben habe) die Datei in zwei Dateien auftrennen, oder aber:

Du übergibst eine weitere Variable, die steuert, welcher Teil sichtbar sein soll.
z.B. menue.php?navi=1, dann gibst du nur die Navigation aus, indem du die beiden Teile in unterschiedliche if' - Konstruktionen haust:
1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10:
if ( 1 == $_GET['navi']) {
   // Die Navigation ausgeben, wie jetzt auch...
} else {
   // Nun muss der Inhalt ausgeben werden, also:
   switch ($_GET['page'] {
      // hier die cases
   }
}


Ich würde die Datei aber auftrennen.
von brali
Marcus schrieb am 31.08.2003 22:03
Jedenfalls gehts so net.

Sehr gut. so geht es nicht!

Passt auf ich Poste mal den gesamten Quellcode der seite. Also der Menue.php

Einzig was passieren soll ist das die Links (wie es jetzt schon passiert) im "Hauptframe"
angezeigt werden. Ohne den inhalt der menue.php

Also komplette Quellangabe:

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
36: 
37: 
38: 
39: 
40: 
41: 
42: 
43: 
44: 
45: 
46: 
47: 
48: 
49: 
50: 
51: 
52: 
53: 
54: 
55: 
56: 
57: 
58: 
59: 
60: 
61: 
62: 
63: 
64: 
65: 
66: 
67: 
68: 
69: 
70: 
71: 
72: 
73: 
74: 
75: 
76: 
77: 
78: 
79: 
80: 
81: 
82: 
83: 
84: 
85: 
86: 
87: 
88: 
89: 
90: 
91: 
92: 
93: 
94: 
95: 
96: 
97: 
98: 
99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
156: 
157: 
158: 
159: 
160: 
161: 
162: 
163: 
164: 
165: 
166: 
167: 
168: 
169: 
170: 
171:
<html>
<head>
x
x
x
x
x
x
x
x
<title>xxxxxxxxxxxxxx</title>
<link rel="stylesheet" href="../css/centric.css" type="text/css">
<script language="JavaScript">
function scrollUp() {
   parent.window.scrollTo(0,0);
}
</script>
<script>
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
</script>

<base target="Hauptframe">
</head>
<?php

switch($_GET['page']){

   case '1':
      include('main.php');
      break;
   
   case '2':
      include('uns.php');
      break;
  
   case '3':  
      include('wws.php');
      break;
      
   case '4':
      include('werben.php');
      break;
   
   case '5':
      include('http://xxxxx.de/xxxx/index.php');
      break;
  
   case '6':  
      include(xxxxxx/index.php');
      break;
      
   case '7':  
      include('xxxx/index.php');
      break;
      
   case '8':  
      include('cam.php');
      break;
      
   case '9':  
      include('links.php');
      break;
      
   case '10':  
      include('uban.php');
      break;
      
   case '11':  
      include('kontakt.php');
      break;

   case '12':  
      include('impressum.php');
      break;

   default:
      include('blue.htm');

} ?>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<p style="margin-top: 1; margin-bottom: 1">&nbsp;</p>
<p style="margin-top: 1; margin-bottom: 1">&nbsp;</p>
<p style="margin-top: 1; margin-bottom: 1">&nbsp;</p>
<table cellspacing=0 cellpadding=2 width=145 border=0 height="302">
  <tr height=12> 
    <td colspan="2" height="16" width="141"> 
    <p style="margin-top: 1; margin-bottom: 1"> 
    <img border="0" src="images/main.gif" width="94" height="16"></td>
  </tr>
  <tr> 
    <td valign="top" width="34" height="56">
    <img src="images/leer.gif" width="1" height="1"></td>
    <td width="103" height="56"> <p style="margin-top: 1; margin-bottom: 1; line-height:150%"> 
        <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=1">Startseite</a></p>
      <p style="margin-top: 1; margin-bottom: 1; line-height:150%"><a target="Hauptframe" href="<?=$PHP_SELF;?>?page=2">&Uuml;ber 
        Uns</a></p>
      <p style="margin-top: 1; margin-bottom: 1; line-height:150%">
      <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=3">Wxxxxx</a></p>
    <p style="margin-top: 1; margin-bottom: 1; line-height:150%"> 
    <font color="#FFFFFF">- - - - -</font></p>
    <p style="margin-top: 1; margin-bottom: 1; line-height:150%"> 
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=4">Member werden</a></p>
    </td>
  </tr>
  <tr height=13> 
    <td height=6 colspan="2" width="141"><img src="images/leer.gif" width="1" height="1"></td>
  </tr>
  <tr height=14> 
    <td height=16 colspan="2" width="141"> 
    <img border="0" src="images/interaktiv.gif" width="94" height="16"></td>
  </tr>
  <tr> 
    <td width="34" height="36">&nbsp;</td>
    <td width="103" height="36"> 
    <p style="line-height: 150%; margin-top: 1; margin-bottom: 1">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=5">Bxxxxx</a></p>
    <p style="line-height: 150%; margin-top: 1; margin-bottom: 1">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=6">Gxxx</a></p>
    <p style="line-height: 150%; margin-top: 1; margin-bottom: 1">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=7"xxxxxx</a></p>
    <p style="margin-top: 1; margin-bottom: 1; line-height:150%"> 
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=8">xxxxxxx</a></p>
    <p style="margin-top: 1; margin-bottom: 1"><font color="#FFFFFF">- - - - -</font><p style="margin-top: 1; margin-bottom: 1"><font color="#FFFFFF">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=9">xxxxx</a></font><p style="margin-top: 1; margin-bottom: 1">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=10">Uxxxxxx</a><p style="margin-top: 1; margin-bottom: 1">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=11">Kxxxx</a><p style="margin-top: 1; margin-bottom: 1">
    <font color="#FFFFFF">- - - - -</font><p style="margin-top: 1; margin-bottom: 1">
    <a class="MAINNAV" target="Hauptframe" href="<?=$PHP_SELF;?>?page=12">Ixxxxxx</a></td>
  </tr>
  <tr height=13> 
    <td height=13 colspan="2" width="141"><img src="images/leer.gif" width="1" height="1"><font color="#FFFFFF"><p style="margin-top: 1; margin-bottom: 1">
    ICQ = </font><font color="#99CC00">
    xxxxxxx</font><font color="#FFFFFF"><p style="margin-top: 1; margin-bottom: 1">
    Yahoo = </font><font color="#99CC00">
    xxxxxxx</td>
  </tr>
  <tr height=13> 
    <td height=28 colspan="2" width="141" valign="top"> 
    </td>
  </tr>
  <tr> 
    <td width="34" height="1"></td>
    <td width="103" height="1">
    <form method="POST" name="log_in" action="http://www.xxx.com/kunden/sicherheitszone/xxxxx/auth.php?sid=members">
    <input type="hidden" name="mode" value="post">
    <input type="hidden" name="mid" value="members">
    </form>
    </td>
  </tr>
  <tr> 
    <td width="34" height="12"></td>
    <td width="103" height="12"></td>
  </tr>
  <tr> 
    <td colspan="2" width="141" height="12"><font color="#B1CEED">&nbsp; </font></td>
  </tr>
  <tr align="center"> 
    <td colspan="2" class="LIGHT" width="141" height="1"> </td>
  </tr>
</table>
</body>
</html>



und nun? irgendwas muss es doch geben? irendwas habe ich doch vergessen!? aus welchen grund wird sonst die menue.php mit ausgegeben.


Nach oben