seite in tabelle

hiho

ich habe eine seite, vorlage.php, die in html aufgebaut ist, komplett.

dort sind etliche Tabellen drin.

ich möchte nun in einer dieser tabellen, eine beliebige Datei öffnen lassen.

d.h. wenn ich z.b. in der datei index.php auf den NEWS-Link drücke, dann soll sich die datei vorlage.php öffnen, die eben eine Tabelle enthält, in der eine html oder php datei angezeigt wird.

alles was ich will, ist in einer Tabelle, eine Datei öffnen, d.h. diese datei soll sich in der Tabelle schon öffnen, wenn man die seite (in diesem fall vorlag.php) aufruft.

sie soll sich nicht öffnen, wenn man auf einen link klickt, sondern sie soll sich gleich mit der seite öffnen, also eigentlich wie ein Frame, der auf eine Datei linkt.

vielen dank für eure hilfe

cu
 
Ich gehe mal davon aus, dass in dieser vorlage.php verschiedene Tabellen für verschiedene Verwendungszwecke, und nicht nur diesen einen, stehen.
In diesem Fall würde ich dir ein Templatesystem empfehlen. Damit wäre dein Problem schnell zu lösen.

Ich persönlich kenne zwei:
  » patTemplate
  » Smarty
 
Klingt ja recht interessant dein Problem... Datei in Tabelle öffnen...

kann es sein das du darauf hinauswillst, dass du ein Menü hast und je nach Menü in dein Content-"Fenster" die zum Menüpunkt passende Contentdatei aufgerufen wird?
Es gibt verschiedene Möglichkeiten dafür, u.U. kannst du es auch mit "include" machen, kommt nur auf deine interne Struktur an.

Empfehlen würde ich dir aber auch eher eine Tempalte-Engine, wie bereits erwähnt, Smarty

Wenn du in Bezug auf Smarty konkrete Fragen zu deinem Problem hast, kannst du auch gerne ne PN schreiben...
 
ich versuche es nochmal zu erklären, vllt habe ich mich nur falsch ausgedrückt:

also, hier mal meine vorlag.php (ist in html aufgebaut):

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>HP</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
body {
	background-color: #e1e1e8;
}
a:link {
	color: #0D0880;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #0D0880;
}
a:hover {
	text-decoration: none;
	color: #980D12;
}
a:active {
	text-decoration: none;
	color: #0D0880;
}
a {
	font-size: 12px;
}
-->
</style>
</head>

<body>
<table width="970" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="37">&nbsp;</td>
    <td width="933"><img src="blue.jpg" width="350" height="65"></td>
  </tr>
</table>
<table width="971" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="37">&nbsp;</td>
    <td width="934"><table width="768" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="3"></td>
      </tr>
      <tr>
        <td><table width="916" cellspacing="0" cellpadding="0" style="border:1px solid #0D0880">
          <tr>
            <td width="926"><table width="767" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="136" valign="top"><table width="136" height="21" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="3"></td>
                      <td width="110" height="3"></td>
                      <td width="3"></td>
                    </tr>
                    <tr>
                      <td height="15">&nbsp;</td>
                      <td><table width="130" border="0" cellspacing="1" cellpadding="0">
                          <tr>
                            <td bgcolor="#0D0880">&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td bgcolor="#0D0880">&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                          <tr>
                            <td>&nbsp;</td>
                          </tr>
                      </table></td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr>
                      <td width="3"></td>
                      <td width="110" height="3"></td>
                      <td width="3"></td>
                    </tr>
                </table></td>
                <td width="631" align="left" valign="top"><table width="632" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="632" height="3"></td>
                  </tr>
                  <tr>
                    <td><table width="779" cellspacing="0" cellpadding="0" style="border-left:1px solid #0D0880">
                      <tr>
                        <td width="777"><table width="778" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="3"></td>
                            <td width="775">Vorlage<br>
                              <br>
                              <br>
                              <br></td>
                          </tr>
                        </table>                        </td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="3"></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

ich möchte nun diese seite öffnen, und mit dieser seite soll sich in der Tabelle, in der jetzt "vorlage" steht, eine seite (php, html) öffnen.
ob vorlage dann noch in der Tabelle steht, ist ja egal.

hier ein direkter link zu vorlage.php: Link

so, ich hoffe ihr könnt mir helfen :)

cu
 
Ist nicht schwer: Du ersetzt einfach
Code:
                          <tr>
                            <td width="3"></td>
                            <td width="775">Vorlage<br>
                              <br>
                              <br>
                              <br></td>
                          </tr>
durch
PHP:
                          <tr>
                            <td width="3"></td>
                            <td width="775">
<?php
  include($seite);
?>
                            </td>
                          </tr>

Jetzt kannst du diese Vorlage zusammen mit deiner beliebigen Seite etwa so einfügen:
PHP:
<?php
  $seite = "meine_einzufügende_seite.htm";
  include("vorlage.php");
?>
 
Original geschrieben von Gumbo
Ist nicht schwer: Du ersetzt einfach
Code:
                          <tr>
                            <td width="3"></td>
                            <td width="775">Vorlage<br>
                              <br>
                              <br>
                              <br></td>
                          </tr>

durch
PHP:
                          <tr>
                            <td width="3"></td>
                            <td width="775">
<?php
  include($seite);
?>
                            </td>
                          </tr>


Jetzt kannst du diese Vorlage zusammen mit deiner beliebigen Seite etwa so einfügen:
PHP:
<?php
  $seite = "meine_einzufügende_seite.htm";
  include("vorlage.php");
?>

Gut, aber für was ist die Zeile "$seite = "meine_einzufügende_seite.htm";"?

Danke

cu
 
Zurück