I should know how to come up with this solution but I’m having a bit of brain freeze or something tonight.
I’m trying to secure the font files that I’ll be using so I won’t allow people to download them when they view my css. I figured I’d use a php script to serve the font files (stored below the web root) to my CSS file, but how do I do it?
My CSS would be:
[code]
@font-face {
font-family: ‘TradeGothic BoldCond Twenty’;
src: local(‘TradeGothic BoldCond Twenty’),
url(‘http://example.com/fonts/myscript.php?somekey’),
etc etc etc
}
and use a php script to basically do this:
[code=php]
header(‘Content-Type: font/opentype’);
echo file_get_contents(“/path/to/font.ttf”);
But I need a way of securing it so people can’t just type in [url]http://example.com/fonts/myscript.php?somekey
I am pretty sure that there’s not a single superglobal in $_SERVER that I can rely on, like HTTP_REFERER, but I’m at a total loss of how to do it, at least to the best of my ability.