• 02-12-2008, 14:07:13
    #1
    Üyeliği durduruldu
    Merhabalar.
    ufacık bi sorum olacaktı
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Language" content="en-us" />
    <title>PHP Remote Upload</title>
    </head>
    <body style="background-image: url('http://i28.tinypic.com/141rx1z.jpg'); color: #999999;
    ">
    <div align="center">
    <form action="index.php" method="post" enctype="multipart/form-data">
    <h1>PHP Remote Upload</h1>
    <input type="text" name="url" size=
    "40" style="font-size: 150%; background-color: #414141; border-width: 0px; color: #999999;
    " /><br /><br /><input type="submit" name="submit" value=
    "Download" style="font-size: 150%" /></form>
    </div>
    <?php
    error_reporting(0);
    $remote_file = $_REQUEST["url"];
    $file_name = basename($remote_file);
    $putdata = fopen($remote_file, "r");
    $fp = fopen($file_name, "w");
    while ($data = fread($putdata, 102400))
      fwrite($fp, $data);
    fclose($fp);
    fclose($putdata);
    ?>
    Bu kod URL upload yapıyor.
    yani direk linkini verdiğiniz bi dosyayı hosta yüklüyor.
    Benim sorum ise şu
    tek tek değilde
    bir textarea ile linkleri alt atla yazsam, sonra o sırası geleni yüklese
    Hoş olmazmı
  • 02-12-2008, 16:00:45
    #2
    Üyeliği durduruldu
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Language" content="en-us" />
    <title>PHP Remote Upload</title>
    </head>
    <body style="background-image: url('http://i28.tinypic.com/141rx1z.jpg'); color: #999999;
    ">
    <div align="center">
    <form action="index.php" method="post" enctype="multipart/form-data">
    <h1>PHP Remote Upload</h1>
    <textarea name="url"></textarea><br /><br /><input type="submit" name="submit" value=
    "Download" style="font-size: 150%" /></form>
    </div>
    <?php
    error_reporting(0);
    $remote_files = $_REQUEST["url"];
    $remote_files = explode("\n", $remote_files);
    for($m=0; $m <= sizeof($remote_files); $m++) {
    if ($remote_files[$m] != "") {
    $remote_file = $remote_files[$m];
    $file_name = basename($remote_file);
    $putdata = fopen($remote_file, "r");
    $fp = fopen($file_name, "w");
    while ($data = fread($putdata, 102400))
    fwrite($fp, $data);
    fclose($fp);
    fclose($putdata);
    }
    ?>



    Bi dene bakalım
  • 02-12-2008, 20:01:15
    #3
    Üyeliği durduruldu
    Parse error: syntax error, unexpected $end in /home/oktay/public_html/urlupload.php on line 31
  • 02-12-2008, 20:52:58
    #4
    Kodu incelemedimde verdiği hata for dongusunu kapatmamışsınız ?> den önce bi tane daha } eklersen o hatayı vermez
  • 02-12-2008, 21:00:56
    #5
    Üyeliği durduruldu
    Çok hoş olur
  • 02-12-2008, 23:42:33
    #6
    Üyeliği durduruldu
    o hatayı artık vermiyor.
    fakat 4-5 tane dosyayı alt alta yazıp download a basınca, sadece en alttaki dosyayı 20 Byte olarak atıyor
  • 03-12-2008, 17:58:39
    #7
    kodunuzda "\n" ile parçalamışsınız,
    ama işletim sistemlerine göre bu alt satıra geçme kodu değişiyor "\r\n" de olabiliyor
    alttaki kodun sorununuzu çözeceğine inanıyorum
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Language" content="en-us" />
    <title>PHP Remote Upload</title>
    </head>
    <body style="background-image: url('http://i28.tinypic.com/141rx1z.jpg'); color: #999999;
    ">
    <div align="center">
    <form action="index.php" method="post" enctype="multipart/form-data">
    <h1>PHP Remote Upload</h1>
    <textarea name="url"></textarea><br /><br /><input type="submit" name="submit" value=
    "Download" style="font-size: 150%" /></form>
    </div>
    <?php
    error_reporting(0);
    $remote_files = $_REQUEST["url"];
    $remote_files = str_replace("\r\n","\n",$remote_files);
    $remote_files = explode("\n", $remote_files);
    for($m=0; $m <= sizeof($remote_files); $m++) {
    if ($remote_files[$m] != "") {
    $remote_file = $remote_files[$m];
    $file_name = basename($remote_file);
    $putdata = fopen($remote_file, "r");
    $fp = fopen($file_name, "w");
    while ($data = fread($putdata, 102400))
    fwrite($fp, $data);
    fclose($fp);
    fclose($putdata);
    }
    }
    ?>
  • 03-12-2008, 18:47:40
    #8
    Neden \r\n ile kendinizi yoruyorsunuz anlamadım. Fark edebilir şeylerdir bu yüzden bence daha stabil olan virgül gibi belli bir karaker kullanarak bu işin üstesinden daha kolay gelinir.

    <?php
    error_reporting(0);
    $remote_files = $_REQUEST["url"];
    $remote_files = explode(",", $remote_files);
    for($m=0; $m < count($remote_files); $m++) {
    if ($remote_files[$m] != "") {
    $remote_file = trim($remote_files[$m]);
    $file_name = basename($remote_file);
    $putdata = fopen($remote_file, "r");
    $fp = fopen($file_name, "w");
    while ($data = fread($putdata, 102400))
    fwrite($fp, $data);
    fclose($fp);
    fclose($putdata);
    }
    }
    ?>
    şeklinde daha iyi olacağına inanıyorum. Yigit yogurt olayı.
  • 03-12-2008, 19:35:46
    #9
    Üyeliği durduruldu
    TrGameArea oldu çok teşekkür ederim...
    skipful sanada teşekkür ederim.
    AhmetPasha yıda unutmamak lazım