HTML PHP lesson

refactored code with alt syntax, also added if to open function to
eliminate error when file = 0.