#!/usr/bin/env python3
"""Read the first 3 lines of an inner course page to check its include structure."""
import os

page = '/Applications/XAMPP/xamppfiles/htdocs/aaa/agile-management/csm-certification-training.php'
with open(page, 'r', encoding='utf-8', errors='ignore') as f:
    content = f.read()

print("FIRST 600 CHARS:")
print(content[:600])
print("\n---LAST 300 CHARS---")
print(content[-300:])
print("\n---INCLUDES---")
import re
includes = re.findall(r'include[_once]*[\s\(]*["\'][^"\']+["\']', content)
for inc in includes:
    print(inc)
    
print("\n---HAS HEADER.PHP?", 'header.php' in content)
print("---HAS FOOTER.PHP?", 'footer.php' in content)
print("---SIZE:", len(content))
