pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by gege2061 on Thu 17 Feb 13:42
View followups from -1 and -1 | download | new post

  1. <?php
  2.  
  3. /*
  4. * Copyright Camille Harang
  5. * Copyright (C) 2010-2011 Nicolas Joseph
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see http://www.fsf.org/licensing/licenses/agpl-3.0.html.
  19. */
  20.  
  21. if (!empty ($_SERVER['HTTPS']))
  22. {
  23.   $scheme = 'https://';
  24. }
  25. else
  26. {
  27.   $scheme= 'http://';
  28. }
  29.  
  30. $seeks_uri = 'http://s.s';
  31. $proxy = '127.0.0.1:8250';
  32. $hostname = 'seeks.homecomputing.fr';
  33. $base_url = $scheme.$_SERVER['HTTP_HOST'];
  34.  
  35. if ($_SERVER['REQUEST_URI'] == '/')
  36. {
  37.   $url = $base_url.'/websearch-hp';
  38. }
  39. else
  40. {
  41.   $base_script = $_SERVER['SCRIPT_NAME'];
  42.   $url = $seeks_uri.str_replace ($base_script, '', $_SERVER['REQUEST_URI']);
  43. }
  44.  
  45. $data = array (
  46.   'http' => array (
  47.     'proxy' => $proxy,
  48.     'header' => "Seeks-Remote-Location: $base_url\r\n",
  49.   ),
  50. );
  51.  
  52. if (isset ($_SERVER['HTTP_ACCEPT_LANGUAGE']))
  53. {
  54.   $data['http']['header'] .= 'Accept-Language: '. $_SERVER['HTTP_ACCEPT_LANGUAGE'] ."\r\n";
  55. }
  56. if (isset ($_SERVER['HTTP_REFERER']))
  57. {
  58.   $data['http']['header'] .= 'Referer: '. $_SERVER['HTTP_REFERER'] ."\r\n";
  59. }
  60.  
  61. $context = stream_context_create ($data);
  62. $result = file_get_contents ($url, false, $context);
  63.  
  64. foreach ($http_response_header as $header)
  65. {
  66.   header ($header);
  67. }
  68. echo $result;

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@



Remember me