[PHP5] PHP Datei includen, wie?

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

  • [PHP5] PHP Datei includen, wie?

    So ich will in einem Script eine PHP Datei includen.
    Ich kann es anzeigen lassen per Link wils aber als frame oder sonst was.

    So ist der Code um das als Link anzuzeigen
    PHP Code:
    echo "<a href=\"index.php?action=writecomment&id=$id\">Kommentar verfassen</a> "

  • #2
    include('deine_Datei.php');

    Comment


    • #3
      <include('index.php?action=writecomment&id=$id');>


      geht net

      Comment


      • #4
        ja klar weil du da die "$id" als $id ausgegeben wird und nicht als variabel

        versuchs mal damit:
        include('index.php?action=writecomment&id='.$id);

        PS: sry dieses mal hab ich die "<>" falsch mitkopiert
        Last edited by jmc; 23-05-2006, 19:48.

        Comment


        • #5
          Parse error: syntax error, unexpected '<' in C:\apachefriends\xampp\htdocs\3\showsong.php on line 128
          kommt dann

          und das ist halt die zeile

          <include('index.php?action=writecomment&id='.$id);>

          Comment


          • #6
            PHP Code:
            <?php
            include 'index.php?action=writecomment&id=' $id
            ?>

            Comment


            • #7
              okay hab das gemacht jetz

              include 'index.php?action=writecomment&id=' . $id;

              aber dann bekomme ich einen anderen fehler

              Warning: main(index.php?action=writecomment&id=10521) [function.main]: failed to open stream: Invalid argument in C:\apachefriends\xampp\htdocs\3\showsong.php on line 130

              Warning: main(index.php?action=writecomment&id=10521) [function.main]: failed to open stream: Invalid argument in C:\apachefriends\xampp\htdocs\3\showsong.php on line 130

              Warning: main() [function.include]: Failed opening 'index.php?action=writecomment&id=10521' for inclusion (include_path='.;c:\apachefriends\xampp\php\pear\') in C:\apachefriends\xampp\htdocs\3\showsong.php on line 130

              aber ich denke das könnte an xamp liegen oder?

              Comment


              • #8
                Das Problem wird ein anderes sein:
                Eine Datei index.php?action=writecomment&id=XXXXX gibt es auf dem Server nicht, es gibt nur eine index.php. Ich glaube nicht das PHP mit Dateispezifizierungen (action=writecomment) innerhalb der include-Anweisung zurechtkommt.

                Comment

                Working...
                X