Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 1st, 1999, 04:26 AM
tomasp
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
ok. this is going to be a kind of long post. what i have right now is a webpage with many large videos that i do not want anyone to link from any other page. currently i have on the videos.htm links to script.pl?video=000 .. and it is logging a bunch of stuff and in no way getting in the way of the download. i don't know of a way that right clicking gives off a referrer. this is the current script:
***


#!/usr/local/bin/perl

#HTTP_USER_AGENT

#capture and separate all info passed to the script
$buffer = $ENV{'QUERY_STRING'};

@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$VAL{$name} = $value;
}

open (VIDEOFILE, "video.dat");
while (<VIDEOFILE> )
{
@line = split(/:::/, $_);

#if anyone is reading this, this is cheesy code. the condition should be in
#the while, it just wasnt' working for some reason. oh well. here it is
if ($line[0] eq $VAL{video})
{
$filepath = $line[1];
}
}
close (VIDEOFILE);

if ($ENV{HTTP_REFERER} eq "")
{
$ENV{HTTP_REFERER} = "RIGHT_CLICK";
}

open (LOGFILE, ">>log_videodl.log");
print LOGFILE $VAL{video};
print LOGFILE "---";
print LOGFILE $ENV{HTTP_REFERER};
print LOGFILE "---";
print LOGFILE $ENV{REMOTE_ADDR};
print LOGFILE "---";
print LOGFILE $ENV{REMOTE_HOST};
print LOGFILE "---";
print LOGFILE $ENV{HTTP_USER_AGENT};
print LOGFILE "n";

close (LOGFILE);

print "Content-type: text/htmln";
print "Location: $filepathnn";

***
this currently isn't really doing much except i catch the occasional site linking when people left click.

my goal of the script is. 1. to not interfere in any way 2. to check referrer ( if videos.htm or NO referer (because people use getright and programs like that to resume) then to download the video BUT if there is a referrer and it is not videos.htm to direct them to the main page 3. to log unsuccessful video downloads


ANY and ALL help or suggestions on what could be done better if not totally possible would be very much appreciated.
thank you,
tomas p

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > check referrer while downloading script attempt


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway