dimanche 1 octobre 2017

PHP If statement across files (require/include)

I have following Problem: I want to use a if Statement which i open in the file Header.php and Close in footer.php in a other file, but i always get this error message: Parse error: syntax error, unexpected end of file in /var/www/html/test/header.php on line 3

Header.php:

if($_GET['id'] == ""){

footer.php

}else{

    echo "Test";
}

index.php

require 'header.php';
echo "Hello";
require 'footer.php';

Thank you very much With best regards

Aucun commentaire:

Enregistrer un commentaire