anja: PHP-Seite erstellen.

Hallo!

Ich habe auf einer Seite diese tolle Anleitung gefunden, wie man als absoluter Anfänger seine Seite als php-Datei erstellen kann.
Ich nutze das schon länger, bin zufrieden damit und für meine Zwecke reichts.

So sieht es aus:

<?php

//Copy and paste the HTML that is the same in all your pages (the header and footer) into new files and name them header.inc and footer.inc.
//They will be included at the complete top and bottom of your pages, so you will only have to edit these 2 files if you want to change your layout.

include('header.inc');

if(!$_SERVER['QUERY_STRING']) { ?>

//Paste here the HTML coding you have on your main page. This is what people will see when they go to index.php, without any ?section bit after it.

<? } elseif ($_SERVER['QUERY_STRING'] == "about") { ?>
//Paste here your HTML code on the About page (without the header and footer code, obviously).

<? } elseif ($_SERVER['QUERY_STRING'] == "rules") { ?>
//Paste here your HTML code on the Rules page (without the header and footer code, obviously).

<? } elseif ($_SERVER['QUERY_STRING'] == "join") { ?>
//Paste here your HTML code on the Join page (without the header and footer code, obviously).

<? } elseif ($_SERVER['QUERY_STRING'] == "codes") { ?>
//Paste here your HTML code on the Codes page (without the header and footer code, obviously).

<? } elseif ($_SERVER['QUERY_STRING'] == "members") { ?>
//Paste here your HTML code on the Members page (without the header and footer code, obviously).

<? } elseif ($_SERVER['QUERY_STRING'] == "extra") { ?>
//Paste here your HTML code on the Extra page (without the header and footer code, obviously).

<? }
include('footer.inc'); ?>

ist auch kein Problem, wenn als festen Bereich, der geändert werden soll nur oben ein bisschen habe. Jetzt soll aber der Inhalt (der an den elseif-punkten eingefügt wird) in der Mitte der Seite erscheinen mit "Design" drumherum. Kann man das irgendwo festlegen?

Vielen Dank ..

Anja

  1. Es tut mir leid aber ich habe mir jetzt deine Frage 5 mal durchgelesen und nicht begriffen was du möchtest.

    mfg shexbeer

  2. Hallo!

    Kommt drauf an, was du mit Design meinst.

    Dein PHP-Skript ist so strukturiert, daß es lediglich Kopf-, Inhalts- und Fußbereich _untereinander_ ausgibt.

    Wenn ich jetzt einfach mal annehme, daß du dir z.B. eine Navigationsleiste links und vielleicht noch eine zweite Leiste rechts für diverse Infos wünscht, oder ggf. noch umfangreichere Strukturen, so kannst du entweder den Code für diese Elemente in jedes deiner Inhaltselemente (About, Rules,...) packen (weniger sinnvoll) oder aber die Struktur deiner Seite neu konstruieren. Will heißen dein Skript anzupassen oder gleich ein ganz neues zu schreiben.

    Damit kannst du dir dann jedes nur erdenkliche Design gemäß deiner Wünsche zusammenbasteln. Allerdings würde dies vermutlich eine eingehendere Auseinandersetzung mit (wenigstens) (X)HTML, PHP und CSS verlangen.

    Hoffe ich habe die Frage richtig interpretiert.

    Gruß

    Matthias

    --
    ss:| zu:| ls:[ fo:| de:] va:) ch:? sh:) n4:( rl:( br:> js:| ie:% fl:) mo:}
    http://www.makaio.de/quotations