I am creating a download page but users can just inspect elements to get the direct link. I can't think of any other solution except for this: PHP echo the direct link after 15 seconds.
But the problem is PHP loads before the HTML and javascript. How can I make PHP run in the background while HTML and Javascript are running?
I tried to do the following code below using javascript and ajax but again, if they inspect elements they will see a direct link. But in PHP, if they inspect elements, they will not see the direct link.
This is a sample code:
<p>This paragraph should show before 10 seconds.</p>
<!-- a tag below with innerText of link should show after 10 seconds -->
<a id="test"></a>
<?php
sleep(10);
echo '<script>
document.getElementById("test").innerText = "link";
</script>';
?>
Sorry, I am new to PHP, Thank you!