I’m building a website in which the download link for files will be generated at runtime by connecting to a database and getting the current download link from there.
I was wondering whats the best design path i should take to implement it.
What i have in mind so far, is having a linker.php file which i’ll include in all pages of the site (Where there’s a download link), and in this file i’ll auto-fill a $downloadLink variable and just use <?php echo $downloadLink; ?> wherever i need to use that download link.
Is this the right way to go?
Should I just have the linker.php file auto-execute?
I’m not sure what your db structure is like but. It would probably be helpful to to have in the linker.php file a function that you could pass a variable like:
And on your page you could have
This way each page could request different links.