G
G
gomer17262015-12-18 20:20:56
CMS
gomer1726, 2015-12-18 20:20:56

How should engines be created in PHP?

For example, if you press the registration button site.com/reg.php and if the button is friends, then site.com/friend.php, that is, the handlers are located in each file. And there are sites where it looks like this site.com/reg=ok?asd well, that is, no file names, only code and that's it. And now the question is which of them is better, can it be written as in the first example. Something got confused. I know how to code, but I don’t have the principles of creation, if you can, give a link or a book, please recommend

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2015-12-18
Protko @Fesor

1) read on Wikipedia how HTTP works
2) read in the PHP documentation about SAPI
3) see how fastroute
is implemented 4) stop writing bicycles - deal with existing solutions. Then we try to write bicycles and throw them away, continuing to use ready-made solutions.

E
evnuh, 2015-12-18
@evnuh

The fact that you do not see the file name in the address bar is called routing. It is usually done as follows:
All requests are sent by the web server to one file (usually index.php), and it already parses the transmitted url and routes further.

S
Sergey, 2015-12-18
@gangstarcj

What? reg.php - page. reg=ok?asd -get parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question