Source of "playgoundIframeInject.php"


<?php
// File Name: playgoundIframeInject.php
// Author: R. T. Waysea
// Creation Date: October 20th, 2014

// Remove the "X-Powered-By" header.
header_remove( "X-Powered-By" );

// Check to see if there is an "iframeInject" parameter in the request URL query
// string.
if( isset( $_GET['iframeInject'] ) ) {

  // There is an "iframeInject" parameter, proceed to grab its value. The
  // "$_GET[]" operation automatically performs a round of URL/URI-decoding.
  $iframeInject = $_GET['iframeInject'];

} else {

  // There is no "iframeInject" parameter, use a default value.
  $iframeInject = "staticPage.php";

}

// Return the response body with the "$iframeInject" parameter value.
echo <<<_END
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>IFrame</title>
    <meta charset="UTF-8">
    <meta name="author" content="R. T. Waysea">
    <meta name="generator" content="R. T. Waysea's Twisted Imagination">
  </head>
  <body>
    <h1>IFrame</h1>
    <p>Add an "iframeInject" query string parameter to inject into this page.</p>
    <p>&lt;iframe&gt;</p>
    <iframe src="./$iframeInject" style="border-style: solid; width: 400px; height: 300px;">
    </iframe>
    <p>&lt;/iframe&gt;</p>
  </body>
</html>
_END;
?>