A few days ago I started with web development and the idea is to write a guestbook with a login. A user with a valid user account can login/logout, create new entries and edit his own entries. He can also change his own password and create new user.
The base site (header, footer, navigation, div's etc) is always the same, but the content is different/dynamic: Displays the existing articles, create articles, create user etc.
So my problem is: How can I reuse the HTML code ?
- First way: Include header and footer as includes in every PHP page and print the page results via echo. This has a disadvantage: Using jQuery is difficult (Because jQuery is clientside and output it in PHP gets messy).
- Second way: Every page contains the complete HTML page and makes an jQuery-Ajax call - One change in the design results in changing every file. Also I have to create a PHP file for each request.
Are there any other methods I don't know ?