How do I insert referer-URL into this PHP-function?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Emil
    Confirmed User
    • Feb 2007
    • 5658

    #1

    How do I insert referer-URL into this PHP-function?

    Can anyone help me with this?
    I want to insert a fake-referer-url into this function, does anyone know how to do it?
    Code:
    function download($file_source, $file_target) {
          $rh = fopen($file_source, 'rb');
          $wh = fopen($file_target, 'wb');
          if ($rh===false || $wh===false) {
                  // error reading or opening file
                  return false;
          }
          while(!feof($rh)) {
                  if (fwrite($wh, fread($rh, 1024)) === FALSE) {
                     // 'Download error: Cannot write to file ('.$file_target.')';
                     return false;
                  }
          }
          fclose($rh);
          fclose($wh);
          // No error
          return true;
    Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
    (Signup with ONLY your Email and Password. You can also refer people and get even more.)
  • gornyhuy
    Chafed.
    • May 2002
    • 18041

    #2
    go use the snoopy class... it has referrers and proxies and all that shit setup as easy to use methods and class variables.

    http://sourceforge.net/projects/snoopy/

    icq:159548293

    Comment

    • Calvinguy
      Confirmed User
      • Oct 2002
      • 1752

      #3
      The referral url is set by the browser and you can't change it through a serverside script. There are browser plugins to hide/fake the referral url but that is probably not what you are looking for.

      Comment

      • dissipate
        The Dirty Frenchman
        • Nov 2005
        • 8904

        #4
        it's easy to do with cURL in php

        Comment

        • Emil
          Confirmed User
          • Feb 2007
          • 5658

          #5
          Ahhh ok, I thought I could send a fake-referer while I was requesting to download the file.
          Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
          (Signup with ONLY your Email and Password. You can also refer people and get even more.)

          Comment

          Working...