GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How do I insert referer-URL into this PHP-function? (https://gfy.com/showthread.php?t=760936)

Emil 08-16-2007 11:00 AM

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;


gornyhuy 08-16-2007 11:02 AM

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/

Calvinguy 08-16-2007 11:04 AM

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.

dissipate 08-16-2007 11:05 AM

it's easy to do with cURL in php

Emil 08-16-2007 11:06 AM

Ahhh ok, I thought I could send a fake-referer while I was requesting to download the file.


All times are GMT -7. The time now is 04:10 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123