[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

How to add HTML-code around streaming anti-leech script?

Asked by rhoepperger in PHP Scripting Language

Tags: file, found, javascript, leeching, script

Hello,

I found this wonderful anti-leech-script which effectively conceals the location on the server where a particular file is loaded from.  The script is added to the end of this message.

It basically streams the file to the browser and only does so, if certain criteria (anti-leech test) are fulfilled.  Great script!

My problem:
I want to use this script to stream pictures to the browser.  Tested it, works like a charm.
BUT
I have no HTML-code "wrapped" around it.  So I cannot add anything to the picture.  The picture is the only object in the browser window and I can't add any text or JavaScript or other pictures to it.

Question:
Does anybody know how to expand the script so that there actually is an HTML-page in the browser that displays the picture-file?

My assumption is, that it is not possible. But maybe someone in this community knows a way to do it.  Thanks a lot for your help!

Greetings
Reinhard

here's the script...
-------------
<?php

//--------------------------------------
//
// Name: Very Good Anti-Leech Script
// Description:This is the best anti-lee
//     ch script out there. There is now way at
//     all to tell where a file is coming from.
//     What it does is open the file, and strea
//     ms it through the script. This example d
//     emonstrates various functions of PHP.
// By: Steve Oliver
//
// Inputs:$domain - your domain name.
//        $folder - folder that your files are in.
//
//This code is copyrighted and has    // limited warranties.Please see http://
//     www.Planet-Source-Code.com/xq/ASP/txtCodeId.286/lngWId.8/qx/vb/scripts/ShowCode.htm
//     for details.
//--------------------------------------

    /*Anti-Leech script by Steve Oliver
    This is the best anti-leech out there.
    No way of telling where the file is coming from.
    Set the 2 variables below, $domain and $folder.
    You can replace the errors below where commented with html files if wanted.*/


    $domain="www.mydomain.com";   //your domain
    $folder="myfolder";           //folder that the files are in, no lead or trailing slashes


    $filename=stripslashes(urldecode($QUERY_STRING));
    //this can be replaced with
    //if ($filename==""){readfile("http://www.yourdomain.com/invalidfile.html");exit;}
    if ($filename==""){die("<h1>Invalid File Request...</h1>");}

    $refr=getenv("HTTP_REFERER");
    list($remove,$stuff)=split('//',$refr,2);
    list($home,$stuff)  =split('/',$stuff,2);
    //this can be replaced with
    //if ($home!=$domain){readfile("http://www.yourdomain.com/leecher.html");exit;
    if($home!=$domain)
    {
        die("<h1>Leecher!</h1>This file is from $domain");
    }
    else
    {
        $fp=@fopen("http://".$domain."/".$folder."/".$filename,"r");
        if($fp)
        {
            if (ereg(".mp3",$filename)){$xtype="audio/mpeg";}
            elseif(ereg(".zip",$filename)){$xtype="application/x-zip-compressed";}
            elseif(ereg(".exe",$filename)){$xtype="application/x-msdownload";}
            else                          {$xtype="application/octet-stream";}
            Header("Content-Type: $xtype");
            Header("Accept-Ranges: bytes");
            Header("Content-Disposition: ; Filename=$filename");
            readfile("http://".$domain."/".$folder."/".$filename);
        }
        else
        {
            //this can be replaced with
            //readfile("http://www.yourdomain.com/filenotfound.html");exit;
            die("file not found");
        }
    }
?>

 
Related Solutions
Keywords: How to add HTML-code around strea…
 
Loading Advertisement...
 
[+][-]12/15/02 03:35 PM, ID: 7586324Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/15/02 04:48 PM, ID: 7586525Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/15/02 05:58 PM, ID: 7586734Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/15/02 06:06 PM, ID: 7586756Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/15/02 06:32 PM, ID: 7586869Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/16/02 05:45 AM, ID: 7589032Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/16/02 07:16 AM, ID: 7589462Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/16/02 07:32 AM, ID: 7589566Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP Scripting Language
Tags: file, found, javascript, leeching, script
Sign Up Now!
Solution Provided By: RQuadling
Participating Experts: 3
Solution Grade: A
 
[+][-]12/16/02 07:55 AM, ID: 7589673Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/09/04 01:29 PM, ID: 10083741Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01/17/04 10:20 PM, ID: 10139450Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]01/18/04 07:50 AM, ID: 10140514Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89