Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Cercasi script anti-leech file e piccolo aiuto

    Salve,
    cerco un script php contro il leech dei file per un sito web.
    Lo script php inoltre deve creare un codice (anche numerico) randomico che bisogna inserire e per effettuare il download

    Inolte se ho una cartella dove risiendono i file che e' protetta tramite .htaccess e .htpassword, e' possibile creare una pagina in php e inserire link per effettuare il download dei file in modo che non compaia la userid e la password ?

    Grazie

  2. #2
    nessuno riesce a darmi una mano?

  3. #3
    Ho trovao e modificato questo codice che allego funziona bene.
    L'unico problema e che quando carico la pagina in questo modo www.sito.com/prova.php?nomecassetta=playgames , non si porta appreso il valore nel link :
    ('Location: http://www.sito/scarica.php?$cassetta.rar'); come posso fare ?
    <?php
    $cassetta=$_GET['nomecassetta'];

    // we must never forget to start the session
    session_start();

    $errorMessage = '';
    // first check if the number submitted is correct
    $number = $_POST['txtNumber'];

    if (md5($number) == $_SESSION['image_random_value']) {


    // set the session
    $_SESSION['image_is_logged_in'] = true;

    // remove the random value from session
    $_SESSION['image_random_value'] = '';

    // after login we move to the main page
    ('Location: http://www.sito/scarica.php?$cassetta.rar');
    exit;
    }

    else {
    $errorMessage = 'Sorry, wrong number. Please try again';
    }
    ?>

    <?php
    if ($errorMessage != '') {
    ?>
    <p align="center"><font color="#990000"><?php echo $errorMessage; ?></font></p>
    <?php
    }
    ?>
    <form action="" method="post" name="frmLogin" id="frmLogin">

    Enter Number :
    <input name="txtNumber" type="text" id="txtNumber" value="">
    [img]random_image.php[/img]



    <input name="btnLogin" type="submit" id="btnLogin" value="Scarica">
    </form>
    </body>

  4. #4
    questo invece e' lo script per creare l'immaggine :

    <?php
    session_start();

    // make a string with all the characters that we
    // want to use as the verification code
    $alphanum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    // generate the verication code
    $rand = substr(str_shuffle($alphanum), 0, 5);

    // create the hash for the verification code
    // and put it in the session
    $_SESSION['image_random_value'] = md5($rand);

    // create the image
    $image = imagecreate(60, 30);

    // use white as the background image
    $bgColor = imagecolorallocate ($image, 255, 255, 255);

    // the text color is black
    $textColor = imagecolorallocate ($image, 0, 0, 0);

    // write the random number
    imagestring ($image, 5, 5, 8, $rand, $textColor);

    // send several headers to make sure the image is not cached
    // taken directly from the PHP Manual

    // Date in the past
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

    // always modified
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

    // HTTP/1.1
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);

    // HTTP/1.0
    header("Pragma: no-cache");


    // send the content type header so the image is displayed properly
    header('Content-type: image/jpeg');

    // send the image to the browser
    imagejpeg($image);

    // destroy the image to free up the memory
    imagedestroy($image);
    ?>

  5. #5
    problema risolto per quanto rigurada l'invio della variabile
    basta sostituire la segunete riga :

    ('Location: http://www.sito/scarica.php?$cassetta.rar');
    con questa :

    ("Location: http://www.sito/scarica.php?$cassetta.rar");
    chi mi auita per questo problema :

    se ho una cartella dove risiendono i file che e' protetta tramite nomeutente e password e' possibile creare una pagina in php e inserire link per effettuare il download dei file in modo che non compaia : nomeutente@password:<a href="http://...m/file.zip</a> ?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.