Author |
Message |
CodeWarrior
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 12 Jun 2002
Posts: 6
|
Posted:
Wed Jun 12, 2002 2:53 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Here is the original code=
Code: |
<?php
$ADMIN[defaulturl] = "http://phpscriptcenter.com";
$okaysites = array("http://phpscriptcenter.com","http://www.phpscriptcenter.com");
$ADMIN[url_1] = "http://www.phpscriptcenter.com/download.php3?product=";
$ADMIN[url_2] = "http://downloads.com";
$ADMIN[url_3] = "http://downloads.com/new";
///////////////////////////////////////////////////////////////////////
$reffer = $HTTP_REFERER;
if($reffer) {
$yes = 0;
while(list($domain, $subarray) = each($okaysites)) {
if (ereg("$reffer",$subarray)) {
$yes = 1;
}
}
$theu = "url"."_"."$site";
if ($ADMIN[$theu] AND $yes == 1) {
header("Location: $ADMIN[$theu]/$file");
} else {
header("Location: $ADMIN[defaulturl]");
}
} else {
header("Location: $ADMIN[defaulturl]");
}
?>
|
And this is what the read me file says=
1, Open download.php and edit these 3 varibles
$ADMIN[defaulturl] = It will redirect people to this url if they are trying to link to your downloads off there site
@okaysites = sites which can download files off your site
$ADMIN[url_1] = A location to a download folder with some downloads in it
(to add more download locations just put on a new line in the script)
$ADMIN[url_4] = "http://site.com";
$ADMIN[url_5] = "http://site.com";
$ADMIN[url_6] = "http://site.com";
and keep going up a number for as many as you want
2, Upload the script to your website
3, Now just link to the download you want by doing http://yoursite.com/download.php?site=1&file=thefile.zip
On that link it has ( site=1 ) that means it calls the download location ( $url_1 )
just change it to what you want so it calls the correct folder
It looks simple but it doesnt seem to work can anyone try it and give me to code after your done ![Question](/forums/images/smilies/icon_question.gif) |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by CodeWarrior Find all posts by CodeWarrior](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
CodeWarrior
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 12 Jun 2002
Posts: 6
|
Posted:
Wed Jun 12, 2002 3:38 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Or maybe someone knows another script that does the same thing that i can download.? |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by CodeWarrior Find all posts by CodeWarrior](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
jayant
Team Member
![](images/rank_6.gif)
![](http://www.phpbuilder.com/board/avatar.php?userid=132268&dateline=1069059954)
Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India
|
Posted:
Wed Jun 12, 2002 7:43 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Here is the solution for the problem:
1) dont give ending / in URLs
2) either have http://yoursite.com as well as http://www.yoursite.com ,.....
or simply don't give "http://" that is just yoursite.com or subdomain.yoursite.com
if you give yoursite.com then *yoursite.com* will match and be a correct referer. that is all subdomain download.yoursite.com, help.yoursite.com etc. while subdomain.yoursite.com with restrict to *subdomain.yoursite.com* . |
________________________________ Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by jayant Find all posts by jayant](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![Yahoo Messenger Yahoo Messenger](templates/4WebHelp2/images/lang_english/icon_yim.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
CodeWarrior
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 12 Jun 2002
Posts: 6
|
Posted:
Wed Jun 12, 2002 7:38 pm (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Right now i have my download.php file like following=
$ADMIN[defaulturl] = "http://www.kinggamers.com";
$okaysites = array("66.216.30.206","http://kinggamers.com","http://www.kinggamers.com");
$ADMIN[url_1] = "http://www.kinggamers.com/sc/files";
$ADMIN[url_2] = "";
$ADMIN[url_3] = "";
and how i have it now doesnt work it just forwards to http://www.kinggamers.com |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by CodeWarrior Find all posts by CodeWarrior](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
CodeWarrior
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 12 Jun 2002
Posts: 6
|
Posted:
Wed Jun 12, 2002 10:32 pm (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by CodeWarrior Find all posts by CodeWarrior](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
jayant
Team Member
![](images/rank_6.gif)
![](http://www.phpbuilder.com/board/avatar.php?userid=132268&dateline=1069059954)
Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India
|
Posted:
Fri Jun 14, 2002 8:05 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
use
echo $HTTP_REFERER;
to see if it gives the correct referer. some hosts like on F2S it was $HTTP_FORWARDED_FOR
you might be behind a proxy etc. which many times dont give out the referer tags.
you can also try using eregi instead of ereg, that way it will ignore the case. |
________________________________ Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by jayant Find all posts by jayant](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) ![Yahoo Messenger Yahoo Messenger](templates/4WebHelp2/images/lang_english/icon_yim.gif) ![MSN Messenger MSN Messenger](templates/4WebHelp2/images/lang_english/icon_msnm.gif) |
![](images/spacer.gif) |
CodeWarrior
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 12 Jun 2002
Posts: 6
|
Posted:
Fri Jun 14, 2002 9:41 pm (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
can u give me an example because im not good with php. or can u just change the code to what u think would work and just post it up? |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by CodeWarrior Find all posts by CodeWarrior](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
CodeWarrior
Junior WebHelper
![Junior WebHelper Junior WebHelper](images/rank_1.gif)
Joined: 12 Jun 2002
Posts: 6
|
Posted:
Wed Jun 19, 2002 10:15 pm (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Does anyone know of a script that does the same thing but actually works?? i want it so it doesnt show the url to a file so people cant link files off my website to theirs. can anyone help me? |
|
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by CodeWarrior Find all posts by CodeWarrior](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) ![Visit Poster's Website Visit Poster's Website](templates/4WebHelp2/images/lang_english/icon_www.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Jun 23, 2002 7:42 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
The URL will always be visible (if it isn't then people can't access the file), but you can stop people from linking to them from other sites. Check out the scripts at Hotscripts.com. |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Jun 23, 2002 7:56 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Quote: | There is something you can do (similar to the trick we're using for images at 4WebHelp, except it would work for other files), but it requires Apache of course. |
What trick that you are using for 4webhelp images??? |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Jun 23, 2002 7:59 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Andrew, please don't edit my posts in order to reply to them
Here's the code:
Code: | RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://4webhelp.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.4webhelp.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.4webhelp.net.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://search.atomz.com/.*$ [NC]
RewriteRule .*\.(gif|GIF|jpg|JPG)$ http://www.4webhelp.net/images/404.gif [R] |
|
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
Daniel
Team Member
![](images/rank_6.gif)
![](http://www.4webhelp.net/forums/images/daniel_avatar.php)
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sun Jun 23, 2002 8:08 am (22 years ago) |
![Reply with Quote Reply with Quote](templates/4WebHelp2/images/lang_english/icon_quote.gif) ![Back to Top Back to Top](templates/4WebHelp2/images/icon_up.gif) |
Yep. Unless the referrer is one of those, it will display an X, or sometimes this image:
![Image Image](http://www.4webhelp.net/images/404.gif) |
________________________________
![Image Image](http://www.4webhelp.net/images/daniel_sig.gif) |
|
![Offline](templates/4WebHelp2/images/offline.gif) ![View User's Profile View User's Profile](templates/4WebHelp2/images/lang_english/icon_profile.gif) ![Find all posts by Daniel Find all posts by Daniel](templates/4WebHelp2/images/lang_english/icon_search.gif) ![Send Personal Message Send Personal Message](templates/4WebHelp2/images/lang_english/icon_pm.gif) |
![](images/spacer.gif) |
|