Skip to content

Instantly share code, notes, and snippets.

@sbkinney
Created December 17, 2012 18:57
Show Gist options
  • Save sbkinney/4320878 to your computer and use it in GitHub Desktop.
Save sbkinney/4320878 to your computer and use it in GitHub Desktop.
<?php
$to = ''; //Whatever email you want
$subject = 'Test Target';
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$message = "POST: \n";
foreach($_POST as $key=>$value)
{
$message = $message . $key . ' => ' . $value . "\n";
}
$message = $message . $_SERVER['REQUEST_URI'];
}
else if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$message = "GET: \n";
foreach($_GET as $key=>$value)
{
$message = $message . $key . ' => ' . $value . "\n";
}
$message = $message . $_SERVER['REQUEST_URI'];
}
else
{
$message = "WTF";
}
mail($to, $subject, $message);
echo $message;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment