M
M
MakarMS2022-03-04 02:22:19
PHP
MakarMS, 2022-03-04 02:22:19

How to make a link in PHP without specifying a PHP file?

Greetings!
1) How to make a link like this in PHP: localhost/ysKg1Ch . I want to write a photo hosting, but with my skills, everything will come down to a link like this: localhost/view. php?photo=ysKg1Ch . How do I, with a randomly generated link, silently refer to the view.php file, passing ysKg1Ch as a parameter. As a result, I want to get localhost/ysKg1Ch.

2) Similarly with localhost/ysKg1Ch/delete , i.e. already go to the handler for deleting photos

UPD:
As I understand it, next to the photo you can generate a similar .php file, it will be like this, for each photo: localhost/ysKg1Ch.php , but with an increase in the number of photos, I think this is a bad idea .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2022-03-04
@MakarMS

a single entry point and server settings (mod_rewrite or for nginx there are a few other directives), + routing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question