Answer the question
In order to leave comments, you need to log in
How do you properly separate the back-end from the front-end?
Hello.
I always wrote in PHP, then switched to a lesser known language, also for server development, but oh well.
Now I am training to write both front and back.
Now to the problems:
Almost everywhere it is shown that if, for example, PHP is taken, then it can be embedded directly into HTML, but it seems to me that this approach is not entirely correct. I wrote a test blog in such a way that jQuery sent a request to PHP, and PHP, in turn, gave JSON, and even JS itself set a cookie for the user.
So, in fact, which method is still correct - write PHP directly in HTML, or, after all, use PHP as the site's API and send a request to it from JS?
I would like to learn how to combine right away. Thank you for your attention =)
Answer the question
In order to leave comments, you need to log in
Almost everywhere it is shown that if, for example, we take PHP, then it can be embedded directly into HTML
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question