R
R
Roman Grinberg2018-03-28 12:37:18
PHP
Roman Grinberg, 2018-03-28 12:37:18

How to change the appearance of a URL using $_GET?

How can I change the URL type using $_GET to something like this:
page=news?id=1?
Without using $_GET, the URL looks like /news/1.
I can’t find clear documentation, can anyone tell me or tell me where to look?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sanovskiy, 2018-03-28
@GarfieldOfficial

$_GET is a super-global array in PHP that is populated based on the querystring in the url.
By changing it, you will not be able to affect the url in the opposite direction.
Specify what exactly you want to achieve?

V
Vladimir, 2018-03-28
@Falendo

/news/1 - these are the so-called "clean" links, it is more convenient for a person to read and perceive them.
I think you'd be better off parsing them rather than making GET requests to replace them.
If you work in cms, then there are already ready-made tools for switching and working with them. Google or ask Alice)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question