Weiterleitung auf komplette Seite!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Weiterleitung auf komplette Seite!

    Hallo Leute!
    Habe ein 3spalten Layout mit (banner.php, inhalt.php & menue.php)!
    mit "index.php?section=news.php" wird ja dann im inhalt die newsseite gezeigt!
    Wenn ich die news.php aber einzeln aufruf kommt ja nur die (ohne banner, menü)! Wie kann ich denn jede Seite auf die index.php?section=....php.. weiterleiten, dass alles erscheint?!

  • #2
    mhh soweit wie ich das jetzt verstehe...

    in der news.php an anfang:

    PHP Code:
    if (!isset($_GET["section"]) && empty($_GET["section"])) {
        
    header("Location: index.php?section=news.php");

    EDIT:
    Post Editiert


    EDIT:
    Hehe jau Hoffe das hilft weiter :P

    Last edited by Skaschy; 13-05-2005, 22:52.

    Comment


    • #3
      ne, das hab ich ja schon soo ! Ich meinte, wenn man manuell im browser z.B www.domain/news.php eingibt kommt ja nur das was in den News drin ist (ohne den REst .. banner, menue....)!
      richtig kommt man ja nur hin wenn es www.domain/index.php?section=news! Jetzt war meine Frage wie man das machen kann, dass wenn man manuell das eingeben sollte man trotzdem auf die index.php?section=blablabla kommt !=?
      sorry wenn ich micj so schelcht ausdrück !


      edit: haste wohl auh grad geändert .. danke!

      Comment


      • #4
        Mhh... mom

        mach des mal so:

        PHP Code:
        if ($_SERVER["REQUEST_URI"]!="index.php") {
            if (!isset(
        $_GET["section"]) && empty($_GET["section"])) {
                
        header("Location: index.php?section=news.php");
            }
        }

        # UNGETESTET 

        Comment


        • #5
          hmmm.... kommt folgender Fehler wenn man auf die domain kommt:

          Warning: Cannot modify header information - headers already sent by (output started at www\root\dci\inc\menu.php:48) in www\root\dci\inc\home.php on line 2

          Wenn ich nochmal auf den newsbutton drück kommt der Fehler aber nicht mehr!

          EDIT:
          edit: mit dem neuen script auf line 3 natürlich!, aber es geht mit der weiterleitung
          Last edited by buzzi22; 13-05-2005, 23:00.

          Comment


          • #6
            erm

            heisst die datei home.php oder index.php?

            bzw was macht die home.php?

            Comment


            • #7
              ja die home.php is die mit der ich das getestet habe (statt news.php)

              Comment


              • #8
                wo taucht der fehler genau auf? beim aufrufen der index.php?

                Comment


                • #9
                  also wenn auf die index.php komme (also beim aufruf der hautpurl)

                  Comment


                  • #10
                    probiers mal so *g*

                    PHP Code:
                    if ($_SERVER["SCRIPT_NAME"]=="/news.php") {
                        
                    header("Location: index1.php?section=news.php");

                    EDIT:
                    editet
                    Last edited by Skaschy; 13-05-2005, 23:12.

                    Comment


                    • #11
                      jetzt kommt zwar keine Fehlermeldung, aber die weiterleitung funktioniert nicht mehr beim aufrufen der news.php!

                      Comment


                      • #12
                        PHP Code:
                        if ($_SERVER["SCRIPT_NAME"]=="/news.php") {
                            
                        header("Location: index.php?section=news.php");


                        so gute nacht :P

                        Comment


                        • #13
                          hab jetzt einfach die index.php auf index.php?section=news weitergeleitet, dann kommt kein Fehler! .. gute nacht & thx!

                          Comment

                          Working...
                          X