Ich versuche, die Ausgabe der PHP-Datei in HTML mit Server Seite enthält. Hier ist der Code der Datei index.html.Server-Seite enthält Putting PHP in HTML
<!DOCTYPE html>
<html>
<body>
<!--#include file="include.php" -->
<h1>This is a Example Of Server Side Includes</h1>
</body>
</html>
Hier ist der Code meiner Datei include.php.
<?php
echo "Hello From PHP\n";
echo "Hello To HTML\n";
?>
Hier ist der Inhalt meiner .htaccess
Datei.
Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alle gefundenen Dateien in /var/www/html.
Dies ist der Screenshot der Ausführung von index.html.
Does Server Side Includes arbeiten auch in localhost? wenn ja Wie konfiguriere ich? Und wo zu .htaccess Datei in var/www/html.
Sie sagen nicht, dass die HTML-Seite die PHP-Seite enthält. '' ist auskommentiert, probiere ' php include 'include.php';?>' Deine neuen Zeilen sollten auch '
' sein, weil ein '\ n 'ist keine neue Zeile in einem Browser. Siehe auch https://stackoverflow.com/a/19398070/4333555 – chris85
Sollte es nicht '' anstelle von '"? – akond
@akond auch schon versucht, aber nicht funktioniert.Danke –