Server URL

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
s1asher
-


Joined: 20 Mar 2003
Posts: 53

PostPosted: Sun Jun 15, 2003 5:37 pm    Post subject: Server URL Reply with quote

Ok, I think I've seen this before, and I'm pretty sure I;ve set this thing correctly before, but I can't seem to find either examples that I've heard or done it.

What I have got is an anti leech script to stop direct linking to the files.

<?
/*
Copyright (c) 1999 Marcel Lemmen
E-mail: lemmen@support.nl
All rights reserved.

Version: V1.1
Homepage: http://home.support.nl/~lemmen/a-leech.php3

This code provided "As Is" with no warrantees express or implied.
The author and contributors are not liable for anything good or bad
that results from your use of this code.

You are free to distribute this for free provided this notice is included.
Please forward fixes/enhancements to the
author for inclusion in the next revision.

Usage:
Replace $files with the original with your files.
Replace $filenames with the filename people see when
downloading (CAN be different then file's!!!)
Replace $URL with your directory or the other URL.
Replace $additional_info with the info on each file.

That's all!!!

*/

$files=array( 'track01.mp3', 'escreen.exe');
$filenames=array( 'Thank ABBA for the music.mp3', 'Escreen.exe');
$additional_info=array( 'Various artists - Thanx ABBA for the music : 4978602 bytes', 'Shareware program to make a screenshot: 529920 bytes');
$url= "/home/lemmen/public_html/data/";
/* When the files are on another server, use the
whole address (http://www.server.com/dir/) in stead of /home/lemmen... */

$referer=ereg_replace( "\?.", "",$HTTP_REFERER);
$thisfile= "http://$HTTP_HOST$PHP_SELF";

if ($referer!=$thisfile){
echo "<center><big>Homepage: <a href=\"http://home.support.nl/~lemmen\">http://home.support.nl/~lemmen</big><br><hr><br><br></center>";
for ($i=0;$i<count($files);$i++)
echo "<P><A HREF=\"$PHP_SELF?$i\">",$filenames[$i], "</A> $additional_info[$i]\n";
}
else {
$i=$QUERY_STRING;
$total=$url . $files[$i];
Header ( "Content-Type: application/octet-stream");
Header ( "Content-Length: ".filesize($total));
Header( "Content-Disposition: attachment; filename=$filenames[$i]");
readfile($total);
}
?>

The bit in bold is what I'm unsure of. Just wondering what I should set this to for Abyss.
Thanks
s1asher
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun Jun 15, 2003 8:09 pm    Post subject: Re: Server URL Reply with quote

That does not depend on Abyss. It depends on where you have installed your files and only you know where. Just put the correct path to these files there.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
s1asher
-


Joined: 20 Mar 2003
Posts: 53

PostPosted: Sun Jun 15, 2003 11:26 pm    Post subject: Reply with quote

Thanks Aprelium :D
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group