Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Forked from therealklanni/proxy.php
Created March 18, 2012 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortenjust/2071764 to your computer and use it in GitHub Desktop.
Save mortenjust/2071764 to your computer and use it in GitHub Desktop.
Stupidly simple PHP proxy
<?php
// Stupidly simple PHP proxy for AJAX (HTTP GET) requests. Written by Kevin Lanni.
$dest = ''; // Set to the remote script URL (i.e. http://remotehost.com/some.php)
$a = array();
foreach ($_GET as $k=>$v) {
$a[] = "{$k}={$v}";
}
echo file_get_contents($dest.'?'.implode('&',$a));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment