On Tue, 30 Dec 2003, news.php.net wrote:
> Creating unique symlinks would be easier but my development machine is
> Windows and my server is FreeBSD and I can't create file links under
> Windows. Plus, my FreeBSD server is not near me so remote development is
> difficult.
1) windows has symlinks since win2000, however they are named Junctions.
I would recommend visiting sysinternals.com and getting junctions
tool (win2k/xp/2k3 -> miscalenous). Hey, it even comes with source!
2) another way is to make a redirect, so you do:
getFile.php?file=something.zip
and in your code you do:
<?
include "_mylibs.php"
if (userLoggedIn())
header "Location: ".$_REQUEST["file"];
else
echo "Only Valid People Can Login";
?>
3) final way is to pass through the file yourself. Safest way, but
potentially more resource hungry than the two above
in your code you do:
<?
include "_mylibs.php"
if (userLoggedIn())
{
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; ".
"filename=".$_REQUEST["file"]);
readfile($_REQUEST["file"]);
}
else
echo "Only Valid People Can Login";
?>
recommended reads:
http://www.php.net/manual/en/function.header.php
further recommended things to checkout:
freshmeat , and search for anti leecher scripts.
/apz, bringing joy to the world....
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php