0
Well... This may sound strange, but I need to block direct access to a url within my server, releasing it only when the user is redirected from another specific page.
That would be the scheme I’m trying to imagine:
The user accesses this page: meusite.com/home.php? id=xxxxxxx This page will have a DOWNLOAD button, and when clicking on it the user will be taken to: meusite.com/dl.php? id=xxxxxxx
So, I just want it to have access to */dl.php if it’s through */home.php Is there any way to do that?
with pure php or some framework? what you already have ready?
– Alvaro Alves
Pure PHP, the server only accepts pure php. I only have the pages anyway, I already researched about it here and in the EN community, but I found nothing. So I have nothing.
– Diego Queiroz
take a look here, is a tutorial on how to make a basic php routing system
– Alvaro Alves
Right. I’ll review and return with feedback.
– Diego Queiroz
Generates and sends a hash by url and in endpoint you valid this hash. After a while you invalid the hash so it can no longer be accessed directly. Better than that you can use a json web token (generates a token that will be valid for a time determiando).
– fajuchem