1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Hello friend i need a simple help pls ENTER

Discussion in 'HTML & Website Design' started by Manojworld, Jun 30, 2013.

  1. #1
    I found a script for transloading files [​IMG]

    I want to add suufix like when anyone tranload anyfiles then my sitename will auto add in the filename...
    here is the source
    <?php
     
    /**
    * @author Hammad Khan
    * @copyright 2010
    */
    ################################################################################
    # You can set a password for the script.
    # (leave it blank to use without any password)
    ################################################################################
     
    $password = "manoj";
     
    ################################################################################
    # example:
    # without password -> $password = "";
    # with Somik.org as password -> $password = "Somik.org";
    ################################################################################
     
    set_time_limit(0);
    ?>
     
     
     
     
     
    <html>
     
    <body>
    <center>
    <br>
     
     
    <form enctype='multipart/form-data' action='index.php?xfer=true' method='post'>
    <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#000066" width="600" cellpadding="5">
     
    <tr>
     
     
    <tr>
     
    <!- You can add a brief form description here-->
    </font><font face="Arial" size="2" color="#000066">
    &nbsp;
    </font></b></td>
    </tr>
     
    <tr>
    <td colspan="5" bgcolor="#D6DFEF" height="16" width="586" bordercolor="#FFFFFF">
    <font face="Arial" size="1">Enter the url you want to download the file from
    first. If you want a custom file name, fill up the second field (optional)</font></td>
    </tr>
     
    <tr>
    <td height="30" width="36" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <font face="Arial">
    <img border="0" src="d/bc_new.gif" width="28" height="28"></font></td>
    <td height="30" width="91" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <font face="Arial" size="2" color="#000059"><b>From </b>(http://)<b>:</b></font></td>
    <td colspan="3" height="30" width="435" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <font face="Arial"><input type=text name='from' size=58></td>
    </tr>
     
    <tr>
    <td height="30" width="36" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <font face="Arial">
    <img border="0" src="d/bc_new.gif" width="28" height="28"></font></td>
    <td height="30" width="91" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <b><font face="Arial" size="2" color="#000059">To </b>(filename)<b>:</b></font></td>
    <td colspan="3" height="30" width="435" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <font face="Arial"><input type=text name='to' size=58></td>
    </tr>
     
    <tr>
    <td height="30" width="36" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <font face="Arial">
    <img border="0" src="d/bc_new.gif" width="28" height="28"></font></td>
    <td height="30" width="91" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <b><font face="Arial" size="2" color="#000059">Method:</b></font></td>
    <td height="30" width="435" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <select name="method">
    <option value="copy">PHPCopy</option>
    <option value="curl">PHP Curl</option>
    <option value="fget">PHP Fget</option>
    </select>
    </td>
    <td height="30" width="91" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <b><font face="Arial" size="2" color="#000059">Password:</b></font></td>
    <td height="30" width="435" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <input type="password" name='pass' size=15>
    <?php
    if($password != "") echo "(required)";
    ?>
    </td>
    </tr>
     
    <tr>
    <td colspan="5" bgcolor="#B5CBEF" height="25" width="586" background="d/tile_sub.gif"><p align="center">
    <font face="Arial" size="2">
    <input type=submit value='Submit Form' style="border: 3px double #000080; background-color: #D6DFEF">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>
    <font face="Arial" size="2">
    <input type=reset value='Reset Form' style="border: 3px double #000080; background-color: #D6DFEF"></font></td></tr>
    </table></form> <font face="Arial"> <br><br>&nbsp;</font>
     
     
    </center>
    </body>
     
    </html>
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    <?php
     
     
    $folder = "transloaded";
     
     
    if ($_GET[xfer]){ // Transload files if command is present
     
    if($password == $_POST['pass']){
     
    if ($_POST[from] == "") // Blank source url
    {
    print '<p align="center">You forgot to enter the link to the file you want to download.</p>';
    }
    else // Begin transloading
    {
    $from = $_POST[from];
     
    if ($_POST[to] == "")
    {
    $to = basename("$from");
    }
    else $to = $_POST[to];
     
    $down = "$folder/$to";
     
    $method = $_GET['method'];
     
    if($method="copy"){
    if (!copy($_POST['from'],$down))
    {
    echo '<p align="center">Failed to transload file.</p>';
    }
    }
    elseif($method="curl"){
     
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $_POST['from']);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 3000);
    $result =base64_encode(curl_exec ($ch));
    curl_close ($ch);
     
    $handle = fopen($down, 'w+');
    fwrite($handle, $result);
    fclose($handle);
     
    }elseif($method="fget"){
    @$file = fopen ($_POST[from], "rb");
    $fc = fopen($down, "wb");
    while (!feof ($file)) {
    $line = fread ($file, 1028);
    fwrite($fc,$line);
    }
    fclose($fc);
    }
     
    $size = round((filesize("$down")/(1024 * 1024)), 3);
     
     
    ?>
     
     
     
    <center>
    <table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#000066" width="600" cellpadding="5">
    <tr>
    <td bgcolor="#B5CBEF" height="17" width="586" bordercolor="#FFFFFF" background="d/tile_back.gif">
    <p align="center" size="2" color="#FFFFFF"><font face="Arial" color="#FFFFFF"><img border="0" src="d/nav_m.gif" width="8" height="8">
    </font><b>
    <font face='Arial' size=2 color='#FFFFFF'>
    <!- You can add a form title here -->
    &nbsp; Transloading complete</font></b></td>
    </tr><tr>
     
    <!- You can add a brief form description here-->
    </font><font face="Arial" size="2" color="#000066">
    &nbsp;
    </font></b></td></tr><tr>
    <td bgcolor="#D6DFEF" height="16" width="586" bordercolor="#FFFFFF">
    <tr>
    <td height="30" width="562" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <b><font face="Arial"><font color="#000066"><font size="2">File's original link:</font>
    </font></b><font color="#000066"><?php echo $from; ?></font></font></td>
    </tr><tr>
    <td height="30" width="562" bgcolor="#EFF3F7" bordercolor="#FFFFFF">
    <b><font face="Arial"><font size="2" color="#000066">Files new link on your
    site: </font>
    <a href=<?php echo $down; ?>><font color="#000066"><?php echo $to; ?> </b>(<?php echo $size; ?> MB)</font></a></font></td>
    </tr><tr>
    <td bgcolor="#B5CBEF" height="25" width="586" background="d/tile_sub.gif">&nbsp;</td></tr>
    </table>
    </center>
     
     
    <?php
     
    }
     
    }else{
    echo '<p align="center">Incorrect password.</p>';
    }
    }
     
     
    ?>
     
    
    Code (markup):
    Please friend help me asap!
     
    Manojworld, Jun 30, 2013 IP