Antworten auf deine Fragen:
Neues Thema erstellen

PHP/HTML Menü funktioniert nicht

Mausi89

*Mausi*

Hallo,

ich hoffe, mir kann einer weiter helfen, und zwar hab ich folgendes Problem:

Ich hab meine WebSeite mit PHP, CSS und Html gebaut.
Hab ein gerußt aus HTML und hab dort die jeweiligen Bereiche ausgelagert, wie z. B. Menü, Haupttexte.
Jetzt zum Problem:
Wenn ich die Seite online habe, seh ich meine Startseite, wie Sie aussehen soll. Also alles o. k., aber wenn ich jetzt auf einen meiner Menüpunkte gehe, bekomm ich eine 404 Fehler Seite. Irgendwie kommt er mit dem Menü nicht klar.

Kann sich bitte jemand meine Daten mal ansehen, wo der Fehler liegt. Weiß leider nicht mehr weiter.
Falls man Sie nicht sieht ich hab auch eine htaccess- Datei.

Danke schon mal

Schöne Grüße
Mausi89

Hier meine .


Mein Content
PHP:
        <?php $thisPage="normal"; ?>
                <?php
                    switch ($_GET['id'])
                    {
                        case 1:
                            $titel="Über mich...";
                            $text='Wenn ihr mehr Wissen wollt oder noch fragen habt, könnt ihr euch gerne bei mir melden.';
                            $bild='<img src="Bilder/ueber_uns.png" alt="Ueber-Uns">';
                            break;

                        case 2:
                            $titel="Referenzen...";
                            $text='<b>Unsere zufriedenen Kunden...</b>';
                            $bild='<img src="Bilder/referenzen.png" alt="Referenzen">';
                            break;
                     
                     
                        case 3:
                            $titel="Kontakt...";
                            $text='Kontaktieren sie mich';
                            $bild='<img style="margin: 0 0 0 -110px" src="Bilder/kontakt.png" alt="Kontakt">';
                            break;
                     
                     
                        case 4:
                            $titel="Impressum...";
                            $text='Impressum meiner Webseite';
                            $bild='<img src="Bilder/impressum.png" alt="Impressum">';
                            break;
                     
                     
                        default:
                            $titel="Herzlich Willkommen bei <br>
                                    ";
                            $text='<br><b>Schön, dass Sie mich besuchen!</b>


                                   <b>Erfahren Sie mehr dazu auf den <br>
                                   weiteren Seiten...</b>';
                            $bild='<img src="Bilder/home.png" alt="">';
                        }
?>

______________________________________________________________________________

Mein Header

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
 

<!-- header --> 
 
 
    <head>
     
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
    <meta name="description" content="Arbeit">
    <meta name="author" content="Name">
   

     
    <title>
        Test
    </title>
   
        <style type="text/css">
            @import "style.css";
        </style>


        <script type="text/javascript"
            src="jquery-1.6.2.min.js">
        </script>
     
     
        <script type='text/javascript'
            src='anmelden/scripts/gen_validatorv31.js'>
        </script>

        <script type="text/javascript"
            src="anmelden/scripts/pwdwidget.js">
        </script>
     


        <!--[if lt IE 9]>
        <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
     
    </head>
 
    <body>
        <div class="content">
         
         
         
<!-- navi --> 
         
            <nav>
             
                <?php
                    include "menu.php";
                ?>
             
            </nav>
         
         
<!-- / navi -->

     
         
<!-- Hinweis: Die Tabelle wird in den anderen Dateien fortgeführt. -->

______________________________________________________________________________

Mein index

Code:
            <?php
                // Die Variable $title wird vor der Einbindung von header.php definiert damit sie in dieser Datei verfügbar ist
                include "header.php";
            ?>   

<!-- / header -->





<!-- content -->

            <?php
                include "content.php";
            ?>
         
            <section class="sectiontenor">
             
                <div class="text">
                     
                    <?php
                        $site = array ('Home','Über mich...','Referenzen...','Kontakt...','Impressum...');

                        if ($titel == 'Login...') {
                            echo "<h1>".$titel."</h1>";
                            include "anmelden.php";
                        }
                     
                        else if ($titel == 'Passwort zurücksetzen...') {
                            echo "<h1>".$titel."</h1>";
                            include "anmelden/reset-pwd-req.php";
                        }
                        else if ($titel == 'Registrieren...') {
                            echo "<h1>".$titel."</h1>";
                            include "anmelden/register.php";
                        }

                        else if ($titel == 'Kontakt...') {
                            echo "<h1>".$titel."</h1>";
                            include "kontakt.php";
                        }

                        else {
                            echo "<h1>".$titel."</h1>";
                            echo "<div id='scroll'><p>".$text."</p></div>";
                        }
                    ?>


                </div>
             
            </section>
             
            <figure>
                <div>
                     
                    <?php
                        echo $bild;
                    ?>
                 
                </div>
            </figure>

     
<!-- / content -->





<!-- footer -->

            <?php
                include "footer.php";
            ?>

______________________________________________________________________________

Mein Menü

Code:
                <div class="menu">
                    <ul class="ober1">
                        <li class="posi1"><a href="referenzen.html">referenzen</a></li>

                    </ul>
                     <ol class="ober2">
                 
                        <li class="posi2"><a href="ueber-mich.html">über mich</a></li>

                    </ol>
                     <dl class="ober3">
                        <li class="posi3"><a href="home.html">home</a></li>
                     
                    </dl>
                     <ul class="ober4">
                   
                        <li class="posi4"><a href="kontakt.html">kontakt</a></li>

                    </ul>
                     <ol class="ober5">
                     
                        <li class="posi5"><a href="impressum.html">impressum</a></li>
                    </ol>
                 
                </div>

______________________________________________________________________________

Mein htaccess

Code:
RewriteEngine on
RewriteRule ^home.html index.php?id=default
RewriteRule ^ueber-mich.html index.php?id=1
RewriteRule ^referenzen.html index.php?id=2
RewriteRule ^kontakt.html index.php?id=3
RewriteRule ^impressum.html index.php?id=4




AddType application/vnd.ms-fontobject .eot
AddType application/octet-stream .otf .ttf .woff .svg


______________________________________________________________________________

Mein CSS

Code:
@charset "UTF-8";


/* ___________________________ Reset ___________________________ */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
    letter-spacing: 0;
    overflow: visible;
}

/* HTML5 display-role reset for older browsers */

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}



/* __________________________________________ Schrift ________________________________________________ */


@font-face {
    font-family: 'Monotype Corsiva', 'Britannic Bold';
    src: url('Schrift/Lucida_Grande/BritannicBold.eot#') format('eot'),
         url('Schrift/Lucida_Grande/BritannicBold.woff') format('woff'),
         url('Schrift/Lucida_Grande/BritannicBold.ttf') format('truetype'),
         url('Schrift/Lucida_Grande/BritannicBold.otf') format('opentype'),
         url('Schrift/Lucida_Grande/BritannicBold.svg') format('svg'),
     
         url('Schrift/Lucida_Grande/MTCORSVA.eot#') format('eot'),
         url('Schrift/Lucida_Grande/MTCORSVA.woff') format('woff'),
         url('Schrift/Lucida_Grande/MTCORSVA.ttf') format('truetype'),
         url('Schrift/Lucida_Grande/MTCORSVA.otf') format('opentype'),
         url('Schrift/Lucida_Grande/MTCORSVA.svg') format('svg'),
}



/* __________________________________________ Hintergrund __________________________________________ */

body {
    behavior: url(Script/PIE-1.0.0/PIE.htc);
    background-image: url(Bilder/02_1.jpg);
    background-repeat: repeat;
    background-position: center center;
    -pie-background: url('Bilder/hintergrund.jpg') left top repeat, ;
    overflow: hidden;
    min-width: 100%;
    min-height: 100%;
}


.content {
    background-image: url(Bilder/Kasten.png);
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
    margin: auto;
    height: 1180px;
    width: 1620px;
    font-family: 'Monotype Corsiva';
    font-style: normal;
    /*border: solid #585858 1px;*/
    }
 


/* __________________________________________ Menü __________________________________________ */


/* ______________ Hauptmenü ______________ */

nav {
    margin: auto;
    width: 1113px;
    height: 60px;
    top: 319px;
    position: relative;
    font-family: 'Britannic Bold';
    font-style: normal;
}


.menu {
    margin: 0 0 0 226.5px;
    width: 660px;
    height: 100px;
    text-transform: uppercase;
 
}


nav .ober1 {
    color: #d5d5d5;
    font-size: 16px;
    list-style: none;
    top: 9px;
    float: left;
    margin: 28px 0 0 0px;
    transform: rotate(17deg);
}

nav .ober2 {
    color: #d5d5d5;
    font-size: 16px;
    list-style: none;
    top: 9px;
    float: left;
    margin: 58px 0 0 74.5px;
    transform: rotate(7deg);
}

nav .ober3 {
    color: #d5d5d5;
    font-size: 16px;
    list-style: none;
    top: 9px;
    float: left;
    margin: 66px 0 0 74.5px;
 
}

nav .ober4 {
    color: #d5d5d5;
    font-size: 16px;
    list-style: none;
    top: 9px;
    float: left;
    margin: 58px 0 0 74.5px;
    transform: rotate(-7deg);
}

nav .ober5 {
    color: #d5d5d5;
    font-size: 16px;
    list-style: none;
    top: 9px;
    float: left;
    margin: 28px 0 0 74.5px;
    transform: rotate(-17deg);
}




nav ul li a {
    text-decoration: none;
    color: #707173;
}


nav ul li a:focus {
    text-decoration: none;
    color: #9C4C6B;
}


nav ul li a:hover {
    text-decoration: none;
    opacity: 0.5;
}


nav ul li a:active {
    text-decoration: none;
    color: #555556;
}


nav ol li a {
    text-decoration: none;
    color: #707173;
}


nav ol li a:focus {
    text-decoration: none;
    color: #9C4C6B;
}


nav ol li a:hover {
    text-decoration: none;
    opacity: 0.5;
}


nav ol li a:active {
    text-decoration: none;
    color: #555556;
}


nav dl li a {
    text-decoration: none;
    color: #707173;
}


nav dl li a:focus {
    text-decoration: none;
    color: #9C4C6B;
}


nav dl li a:hover {
    text-decoration: none;
    opacity: 0.5;
}


nav dl li a:active {
    text-decoration: none;
    color: #555556;
}

.activ {
    text-decoration: none;
    color: #000000;
}



/* ______________ Untermenü ______________ */

/*nav .unter {
    position: absolute;
    top: 30px;
    padding: 5px 0 0 0;
    top: -9999px;
    margin: 0;
}


nav ul .sub1 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_mittel_1.jpg);
}


nav ul .sub2 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_mittel_2.jpg);
}


nav ul .sub3 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_mittel_3.jpg);
}


nav ul .sub4 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_mittel_4.jpg);
}


nav ul .sub5 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_lang_1.jpg);
}


nav ul .sub6 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_lang_2.jpg);
}


nav ul .sub7 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_lang_3.jpg);
}


nav ul .sub8 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_lang_4.jpg);
}


nav ul .sub9 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_kurz_1.jpg);
}


nav ul .sub10 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_kurz_2.jpg);
}


nav ul .sub11 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_kurz_3.jpg);
}


nav ul .sub12 {
    float: none;
    margin: 2px 0 0 -15px;
    text-align: left;
    list-style: none;
    background: url(Bilder/subnavi_kurz_4.jpg);
}


.sublink {
    color: #BDBDBD;
    font-size: 13px;
    display: block;
    margin: 0 0 0 0;
    line-height: 24px;
    padding: 0 15px 0 15px;
}


nav ul li:hover .unter {
    top: auto;
}*/



/* __________________________________________ Content __________________________________________ */


/* ____________ Haupttext ____________ */

.sectiontenor {
    margin: auto;
    width: 1063px;
    height: 336px;
    top: 370px;
    position: relative;
    /*border: solid #585858 1px;*/
}


.text {
    color: #333333;
    font-family: 'Lucida Grande', 'Lucida Sans';
    /*display: inline-block;*/
    margin: 26px 0 0 41px;
    width: 320px;
    height: 283px;

}


h1 {
    font-size: 16px;
    font-style: normal;
    line-height: none;
    padding: 0 0 14px 0;

}

#scroll {
    overflow: auto;
    width: 713px;
    height: 273px;
}

p {
    font-size: 12px;
    font-style: normal;
    line-height: 17px;
    width: 320px;
}


.aufzählung {
    font-size: 12px;
    font-style: normal;
    line-height: 17px;
    margin: 0 0 0 35px;
    list-style-position: outside;
    list-style-type: disc;
}



/* ____________ Formular ____________ */

form {
    width: 232px;
    margin: 5px 0 0 0;
    padding: 5px;
}


#fg_membersite fieldset {
    padding: 5px;
}


#fg_membersite textarea {
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-size: 12px;
    color: #303030;
    padding : 3px;
    resize: none;
}


/*Kontakt*/

.pflichtfelder {
    color: #8d8d8d;
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-size: 10px;
    font-style: normal;
    text-align: right;
    margin: 0 0 0 -37px;
}


#fg_membersite .labelclass {
    display: inline-block;
    color: #8d8d8d;
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-size: 12px;
    font-style: normal;
    margin: 0 0 4px 0;
    width: 100px;
}


#fg_membersite .container2 {
    cursor: pointer;
    width: 286px;
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-size: 12px;
    margin: -14px 0 20px 0;
}


#fg_membersite .container3 {
    cursor: pointer;
    width: 284px;
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-size: 12px;
    margin: -16px 0 8px 0;
}


#fg_membersite .button {
    cursor: pointer;
    width: 106px;
    height: 21px;
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-size: 12px;
    border: 1px solid #d3d3d3;
    border-color: #d3d3d3 #888888 #888888 #d3d3d3;
    background: #f7f7f7;
    color: #666666;
    text-align: justify;
}


#fg_membersite .short_explanation3 {
    margin: 0 10px 0 0;
    /*display: inline-block;*/
    float: left;
    border: 1px solid;
    border-color: #0000ff;
}

/*Kontakt ende*/






/* _____________ Bild _____________ */

figure {
    height: 336px;
    width: 338px;
    display: inline-block;
    margin: -113px 0 0 491px;
    padding: 0 0 0 55px;
}



/* __________________________________________ Footer __________________________________________ */

footer {
    margin: auto;
    width: 763px;
    height: 64px;
}


address {
    color: #666666;
    font-size: 12px;
    line-height: normal;
    font-family: 'Lucida Grande', 'Lucida Sans';
    font-style: normal;
    list-style: none;
    margin: 19px 0 0 41px;
}


address .posi2 {
    display: inline-block;
}


address .posi3 {
    margin: 0 0 0 56px;
    display: inline-block;
}
 
Zuletzt bearbeitet:

owieortho

Aktives Mitglied

Deine Downloadseite versucht Adware zu installieren.... vergiss es!
Nimm bitte die Möglichkeit, hier im Forum Quelltexte anzuzeigen und dann kann man weitersehen.

O.
 

hub

nicht ganz neu hier

Moin,
@pummuk , die "Unterseiten" fehlen nicht, die werden über die .htaccess auf die index.php gemappt.
@Mausi89 , in Sachen .htaccess bin ich kein Experte, aber hast du mal getestet, ob mod_rewrite auf dem Server aktiv ist?
 

Mausi89

*Mausi*

HI,

danke für die schnellen Antworten.
@pummuk Der sin war für mich darin das so zumachen das ich, wenn ich mehr Menüpunkte hab, keine 100 Dateien hab, sondern alle Texte in einer.
@hub Danke für den Tipp. Aktiviert war es, aber wenn man alles auf einen Onlineserver lädt, muss man in der .htaccess-Datei einen / vor index.php schreiben.

z. B. so hatte ich es vorher
RewriteRule ^home.html index.php?id=default

jetzt so
RewriteRule ^home.html /index.php?id=default

und so funktioniert es auch.

Danke noch mal.
 

pummuk

PSD Beta Team

PSD Beta Team
@Mausi89 das mit den Menüpunkten ist mir klar, das das auslagern und einbinden praktischer ist. Nur noch eine Datei zum bearbeiten, wenn sich das Menü verändert.

aber das mappen auf die Index datei per .htaccess erklärt sich mir nicht...
 

tr4ze

Mod | Forum

Teammitglied
PSD Beta Team
@tr4ze danke für dem Link. der paßt aber nicht wirklich dazu.... es wird per .htaccess die Menü-Verknüpfung zu den Unterseiten auf die index-datei weitergeleitet. da bleib ich hängen warum es so gemacht wird.
Doch das passt schon.
Die RewriteRule mappt die PHP Variable id auf die verschiedenen HTML Unterseiten. Resultat ist eine CleanURL, der man von aussen die technische Umsetztung nicht mehr ansieht.
 
Bilder bitte hier hochladen und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Antworten auf deine Fragen:
Neues Thema erstellen

Willkommen auf PSD-Tutorials.de

In unseren Foren vernetzt du dich mit anderen Personen, um dich rund um die Themen Fotografie, Grafik, Gestaltung, Bildbearbeitung und 3D auszutauschen. Außerdem schalten wir für dich regelmäßig kostenlose Inhalte frei. Liebe Grüße senden dir die PSD-Gründer Stefan und Matthias Petri aus Waren an der Müritz. Hier erfährst du mehr über uns.

Stefan und Matthias Petri von PSD-Tutorials.de

Nächster neuer Gratisinhalt

03
Stunden
:
:
25
Minuten
:
:
19
Sekunden

Neueste Themen & Antworten

Flatrate für Tutorials, Assets, Vorlagen

Zurzeit aktive Besucher

Statistik des Forums

Themen
118.565
Beiträge
1.538.067
Mitglieder
67.488
Neuestes Mitglied
Andrew56524
Oben