|
|||
xhtml php datei
hi
ich bin so ziehmlich neu was html und so betrifft und ich habe folgenes problem ich soll ne homepage schreiben in xhtml und mit hilfe von php den inhalt der seite ändern Zitat:
1. ich soll mit dem <div id="left"> die verschiedenen seiten laden, was soweit auch klappt aber ich kriege es nicht hin die verschiedenen *.txt dateien auf den entsprechenden seiten einzufügen 2.ich habe es in php gespeichert weil der <?php ?> teil wird bei mir sonst in grau angezeigt und total ignoriert hoffe ihr könnt mir helfen mfg haku |
Sponsored Links |
|
|||
Füge nur jeweils die entsprechende txt ein, z.B. für die Seite Start nur start.txt, bei über mich nur about.txt usw.
Ich weiß nicht, ob das mit txt geht, evtl. umbennen in .php (aber wie gesagt, das weiß ich nicht) |
Sponsored Links |
|
|||
das einfügen ist kein problem das geht auch
aber ich soll halt nur wenn ich auch "über mich" klicke wird die gleiche seite eig nur neu geladen und was in dem <div id="middle"> steht soll verändert werden also soll die "About.txt" geladen werden und das auch für die anderen |
|
|||
es wird nur der txt-Teil ausgetauscht, der Rest bleibt gleich.
für <li><a href="ich.php?Start">Startseite</a></li> HTML-Code:
<div id="middle"> <?php include("Start.txt");?> </div> HTML-Code:
<div id="middle"> <?php include("About.txt");?> </div> HTML-Code:
<div id="middle"> <?php include("Interessen");?> </div> |
|
|||
ok, ich meinte nicht das Du es ersetzen sollst, sondern jeweils für diese Seite einfügen sollst.
Mal in ganz einfach: Deine Seite ich.php: HTML-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Fabian Wilke</title> <style type="text/css"> html, body { color: lime; font-size: 20px; } body { background-attachment: fixed; background-image: url("layout.jpg"); background-position: absolut; } #layout { position:relative; margin: 0 auto; width: 1200px; height: 800px; } #logo { margin-top: -20px; height: 200px; width: 100%; } #main { height: 100%;} #left { width: 200px; height: 100%; float:left; border-color: white; border-width: 1px; border-style: dotted; } #middle { width: 780px; border-color: white; border-width: 1px; border-style: dotted; position: absolute; margin-top: 100px; left: 50%; margin-left: -390px; text-align: center; padding: 10px; } #right { width: 175px; height: 100%; float: right; border-color: white; border-width: 1px; border-style: dotted; } #feet { margin-bottom: 0px; height: 100px; } .text { text-align: center; padding: 5px; width: auto; } #navi { width:200px; text-align:left; margin-top:10px; margin-bottom:10px; margin-left: -20px; margin-right:15px; } #navi ul{ list-style:none; } #navi li { background-color:black; border-top:1px; border-top-color:green; border-top-style:solid; border-left:25px solid; border-left-color: ff0033; border-bottom:1px red solid; border-right:2px blue solid; margin-top:10px; padding-top:8px; padding-bottom:8px; padding-left:8px; padding-right:8px; } a { color:lime ; } </style> </head> <body> <div id="layout"> <div id="logo"> <p align="center"><img src="logo.gif" height="300" width="600"/></p> </div> <div id="main"> <div id="left"> <div id="navi"> <ul> <li><a href="ich.php?Start">Startseite</a></li> <li><a href="ich.php?About">Über mich</a></li> <li><a href="ich.php?Interessen">Interessen</a></li> </ul> </div> </div> <div id="middle"> <?php include("About.txt");?> </div> <div id="right"> login und werbung </div> </div> <div id="feet"> Kontakt </div> </div> </body> </html> um es dann "noch richtiger" zu machen, solltest Du HTML-Code:
<li><a href="ich.php?About">Über mich</a></li> HTML-Code:
<li><strong>Über mich</strong></li> |
|
|||
evtl. eine if-Abfrage?
If... Seite/url=ich.php?Interessen include .... oder so ansonsten kann ich Dir nicht weiterhelfen, dazu bin ich auch nicht fit genug dafür... Geändert von TanjaP. (13.07.2011 um 18:25 Uhr) |
|
|||
Man macht das mit $_GET
angenommen Du hast folgende URL: http://www.domain.com/index.php?seite=home dann kannst Du mittels: PHP-Code:
Schau mal ob Du damit weiterkommst. LG |
Sponsored Links |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
XML Datei in eine XHTML Datei einbinden | danny.b | (X)HTML | 5 | 22.12.2008 08:06 |
Nachmal XHTML, PHP, MySQL und UTF-8 | ollo | Serveradministration und serverseitige Scripte | 17 | 26.08.2007 01:15 |
MathML und PHP in einer Datei | hal0006 | (X)HTML | 9 | 07.02.2007 11:53 |
XHTML mit PHP code validieren | Astarot | (X)HTML | 2 | 24.06.2006 10:33 |
noch mal xhtml | Broken | CSS | 13 | 03.08.2003 22:56 |