Last active
December 19, 2015 15:49
-
-
Save christopherhill/5978974 to your computer and use it in GitHub Desktop.
Marketo Web Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$staging = "http://marketostaging.domain.com/index.php/leadCapture/save"; | |
$production = "http://marketoproduction.domain.com/index.php/leadCapture/save"; | |
$url = ''; | |
if (isset($_GET["s"])) { | |
$stagingFlag = $_GET["s"]; | |
if ($stagingFlag == "true") { | |
$url = $staging; | |
} else { | |
$url = $production; | |
} | |
} else { | |
$url = $production; | |
} | |
if (isset($_GET["Email"])) { | |
$options = array( | |
'http' => array( | |
'header' => "Content-type: application/x-www-form-urlencoded\r\n", | |
'method' => 'POST', | |
'content' => http_build_query($_GET), | |
), | |
); | |
// todo: must try to preserve referer, which is currently correct due to the simultaneous firing of the createLead API call. | |
$context = stream_context_create($options); | |
$result = file_get_contents($url, false, $context); | |
// var_dump($result); | |
} else { | |
header("HTTP/1.0 403 Forbidden"); | |
} | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment