[PHP] - Simple Remote Download Script

Discussion in 'Programming & Reverse Engineering' started by nababan, Jul 26, 2009.

  1. nababan

    nababan New Member

    Messages:
    66
    Likes Received:
    18
    Trophy Points:
    0
    Simple Remote Download Script

    Code:
    <?php
    $sv = array_merge ($_ENV, $_SERVER, $HTTP_ENV_VARS, $HTTP_SERVER_VARS);
    $sp = array_merge ($HTTP_POST_VARS, $HTTP_GET_VARS);
    
    define ('SAVE','files/');
    class STS
    {
    function dl($url,$name)
    {
    $filename = SAVE.basename($url);
    if ($name) $filename = SAVE.$name;
    if ($save = fopen($filename, 'w'))
    {
    $content = $this->useCurl($url);
    if (fwrite($save, $content) === FALSE)
    return array(0,'Error Writing to '.$filename);
    fclose($save);
    return array(1,$filename);
    } else {
    return array(0,'Error Opening File '.$filename);
    }
    }
    function useCurl($url)
    {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    $execute = curl_exec($ch);
    curl_close($ch);
    return $execute;
    }
    }
    if (isset($sp[start]) && isset($sp[file]))
    {
    $a = new STS();
    $hasil = $a->dl($sp[file], time()."imzers".$sp[saveas]);
    if ($hasil[0])
    {
    echo "File downloaded in:<br/> ";
    echo "<a href="http://{$_SERVER['SERVER_NAME']}/".$hasil[1]."">http://{$_SERVER['SERVER_NAME']}/".$hasil[1]."</a><br/> ";
    echo "BBCode at forum:<br/> ";
    echo "http://{$_SERVER['SERVER_NAME']}/".$hasil[1]."<br/> ";
    } else {
    echo 'Download Failed<br/>Err: '.$hasil[1];
    }
    } else {
    echo "<form method=post>File URL To Copy:<br/> ";
    echo "<div><input name="file" type="text"><br/><br/> ";
    echo "Save File As:<br/> ";
    echo "<input name="saveas" type="text"><br/><br/> ";
    echo "<input type="submit" name="start" value="Start Copy"> ";
    echo "</div></form> ";
    }
    
    ?>
    
    syarat nya webhosting kamu harus support cURL
     
    Last edited by a moderator: Jul 26, 2009
  2. nababan

    nababan New Member

    Messages:
    66
    Likes Received:
    18
    Trophy Points:
    0
    wah ga ada yg tertarik ya
    ga ada komentar :)
     
  3. widuri2005

    widuri2005 Active Member

    Messages:
    251
    Likes Received:
    99
    Trophy Points:
    38
    bukanya tidak tertarik gan....
    saya tidak begitu paham hal beginian, jd ga tau mau comment apaan.
    jadi cm baca2 doang..
    he...he...
     
  4. regmon

    regmon Active Member

    Messages:
    766
    Likes Received:
    25
    Trophy Points:
    38
    ga ngarti gan
     
  5. nerodawerty

    nerodawerty New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    tuh cara makenya gimana...
    maklum gan ....
     
  6. bammms

    bammms New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    ane butunya script penjualan online gan....klo punya berbagilah......!

    matur nuhun...gan.
     
  7. arieemdee

    arieemdee Moderator Moderator

    Messages:
    258
    Likes Received:
    272
    Trophy Points:
    73
    Shopping Cart


    Visual Studio Solution
    Database SQLServer

    Cara Mengcopy Database Agar dapat dibuka melalui SQLClient:
    1. Copy File database dari Folder Database
    2. Pastikan anda telah menginstall SQL Server 2005 / Express 2005
    3. Letakan File pada folder data Sql Server, Contohnya :
    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
    Sesuaikan Path diatas pada komputer anda

    Cara Membuka Contoh Website :
    1. Dari Menu File pilih Open, Kemudian Klik WebSite
    2. Pilih Folder ShoppingChart

    File Sample.rar - 4shared.com - online file sharing and storage - download

    Selamat Mencoba
     

Share This Page