HWE-Forum.de

Internet und Co. => HTML, PHP, XML, JavaScript u. Co. => Thema gestartet von: Kevin1988 am 11. Juli 2006, 12:25:30 Uhr

Titel: include innerhalb <?php [...] ?>
Beitrag von: Kevin1988 am 11. Juli 2006, 12:25:30 Uhr
Hallo an alle ich hab da ein roblem.

ich habe eine HP in PHP gemacht =>


<?php

if (!empty($HTTP_GET_VARS["se"]))
$se $HTTP_GET_VARS["se"];
else
$se "default";

if (!empty( $_SERVER["PHP_SELF"] ))
  
$PHP_SELF $_SERVER["PHP_SELF"];


if ($se == "default" )
{
echo '<a href="'."$PHP_SELF".'">

<html>
<head>
<title>TEST-Layout</title>
<meta name=author content=Senate>
<link rel=stylesheet href=images/style.css btype=text/css>
<script language=Javascript
src=images/zeit.js>
</script>
</head>
<body background=images/background.jpg text=#444444 bgcolor=#9f9e9e link=#FF0000 alink=#FF0000 vlink=#FF0000 onLoad=zeitanzeige()>
<!-- Top Anfang-->
<div align=center style=padding-top: 6px>
<table class=tablea bordercolor=9f9f9f border=0 width=90%>
<tr class=top>
 <td width=85% height=100>{Top Banner}</td>
 <td>{Top Banner (small) 2nd}</td>
</tr>
</table>
</div>
<!-- Top Ende-->
<div align=center style=margin-top=10px>
<table class=tablea border=0 width=90%>
<tr class=links>
 <td width=15% valign=top><a href=>Startseite</a><br><a href=?se=aktuelles>Aktuelles</a><br><a href=?se=impressum>Impressum</a><br>Link #3<br>..</td>
<!-- Content Anfang-->
 <td class=content_bg>
 <table class=tableb bordercolor=000000 border=0 width=100%>
<tr class=news_text>
 <td width=83% valign=top><b>Meldungen des Tages</b><td><span id=Uhr>&nbsp;</span></td></td>
</tr>
</table>
 <!-- Meldung 1-->
<div style=margin-top=10px;>
 <table class=tablea border=0>
<tr class=news_text width=100%>
 <td width=84% valign=top>
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <br>
 Sed adipiscing gravidafelis. Integer sed dolor vel lacus aliquam <br>
 pulvinar. Suspendisse potenti. Quisque consectetuer [...]<br><br>
 <div align=right><a href=meldungen.php?show=1>[weiterlesen]&nbsp;</a></div><td><img src=images/nopic.gif border=0></td>
 </td>
</tr>
</table>
 <!--Meldung 1 Ende-->
<!-- Meldung 2-->
<div style=margin-top=10px>
 <table class=tableb bordercolor=000000 border=0>
<tr class=news_text width=100%>
 <td width=84% valign=top>
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <br>
 Sed adipiscing gravidafelis. Integer sed dolor vel lacus aliquam <br>
 pulvinar. Suspendisse potenti. Quisque consectetuer [...]<br><br>
 <div align=right><a href=meldungen.php?show=1>[weiterlesen]&nbsp;</a></div><td><img src=images/nopic.gif border=0></td>
 </td>
</tr>
</table>
 </td>
<!--Meldung 2 Ende-->
 </td>
 <td width=15%><i>weitere Links [...]</i></td>
<!-- Content Ende-->
</tr>
</table>
</div>
</div>
<!-- Footer Anfang-->
<div align=center style=margin-top=10px>
<table  class=tablea bordercolor=000000 border=0 width=90%>
<tr>
 <td width=20%>Design by .. </td>
 <td>{Footer} </td>
 <td width=20%>Copyright by .. </td>
</tr>
</table>
<!-- Footer Ende-->
</div>
</body>
</html>'
;
       }

 if (
$se == "aktuelles" )
{
         echo 
"
         <html>
<head>
<title>Aktuelles</title>
<meta name=author content=Senate>
<link rel=stylesheet href=images/style.css btype=text/css>
<script language=Javascript
src=images/zeit.js>
</script>
</head>
<body background=images/background.jpg text=#444444 bgcolor=#9f9e9e link=#FF0000 alink=#FF0000 vlink=#FF0000>
<!-- Top Anfang-->
<div align=center style=padding-top: 6px>
<table class=tablea bordercolor=000000 border=0 width=90%>
<tr class=top>
 <td width=85% height=100>{Top Banner}</td>
 <td>{Top Banner (small) 2nd}</td>
</tr>
</table>
</div>
<!-- Top Ende-->
<div align=center style=margin-top=10px>
<table class=tablea bordercolor=000000 border=0 width=90%>
<tr class=links>
 <td width=15% valign=top><a href=>Startseite</a><br><a href=?se=aktuelles>Aktuelles</a><br><a href=?se=impressum>Impressum</a><br>Link #3<br>..</td>
 <!-- Content Anfang-->
 <td class=content_bg>
 <table class=tablea bordercolor=000000 border=0  width=83%>
<tr class=news_text>
 <td width=80% valign=top><b>Meldungen des Tages</b><td><span id=Uhr>&nbsp;</span></td></td>
</tr>
</table>
<div style=margin-top=10px>
 <table class=tablea bordercolor=000000 border=0 width=83%>
<tr class=news_text width=100%>
 <td width=75% valign=top> {text, news, Aktuelles}<br>...<td><img src={IMG} height=100 width=150 alt={IMG} border=0></td></td>
</tr>
</table>
 </td>
 <!-- Content Ende-->
</tr>
</table>
</div>
</div>
<!-- Footer Anfang-->
<div align=center style=margin-top=10px>
<table class=tablea bordercolor=000000 border=0 width=90%>
<tr>
 <td width=20%>Design by .. </td>
 <td>{Footer} </td>
 <td width=20%>Copyright by .. </td>
</tr>
</table>
<!-- Footer Ende-->
</div>
</body>
</html>"
;
       }
?>



so..

jetzt will ich abr INNERHALB dieses php (<?php [...]?> )

ein
<? include ("datei.php"); ?>
haben.

Sinn soll sein,
dass an einer bestimmten stelle der seite, TEXT aus einer andern datei eingefügt werden soll..

so.. nun geht das abr nicht, wenn ich eingach
<? include ("datei.php"); ?>
da einsetze :?
was mache ich falsch ???
Titel: Re: include innerhalb <?php [...] ?>
Beitrag von: Kevin1988 am 11. Juli 2006, 15:44:02 Uhr
wieso antworter hier NIE einer? ? ?
Titel: Re: include innerhalb <?php [...] ?>
Beitrag von: Gudi am 11. Juli 2006, 18:55:26 Uhr
weil:

(a) du nur 3 h gewartet hast...
(b) du deine frage nicht wirklich gut formuliert hast.

du könntest zB ein vernünftiges code-beispiel geben, bei dem das problem auftritt und schreiben, wie genau die fehlermeldung aussieht, bzw was genau unerwartetes passiert.
Titel: Re: include innerhalb <?php [...] ?>
Beitrag von: Kevin1988 am 11. Juli 2006, 19:48:17 Uhr
Ok... tut mir leid.

Hab das Problem anders gelöst.

Ich hab die index.php geteilt in:
header.php
footer.php
und
index.php

die index.php sieht so aus.
<? include ("header.php"); ?>
<b>Hier steht der Ihnalt</b>
<? include ("footer.php"); ?>

header so:
<html>
<head>
</head>
<body>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><img src="headergrafik.jpg"></td></tr>
<tr>
<td>
<a href="index.php"><b>Startseite</b></a><br>
<a href="#"><b>link</b></a><br>
<a href="#"><b>link</b></a><br></td>
<td>


footer so:
</td>
</tr>
</table>
</body>
</html>


Genau so wolte ich das auch machen mit dem beispiel, dass das

<? include ("datei.php"); ?>
innerhalb eines php-tags ist.

so. habs jezt aber anders gelöst...
Titel: Re: include innerhalb <?php [...] ?>
Beitrag von: damdidum100 am 17. Juli 2006, 20:28:03 Uhr
kp