Created
September 9, 2010 06:35
-
-
Save FiXato/571487 to your computer and use it in GitHub Desktop.
Simple function to return object or iframe code, based on HTTP_ACCEPT
This file contains hidden or 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 | |
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) { | |
header("Content-type: application/xhtml+xml"); | |
} | |
else { | |
header("Content-type: text/html"); | |
} | |
function iFrameBuild($id,$src) | |
{ | |
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) | |
{ | |
return '<object id="'.$id.'iFrame" standby="Loading '.$id.' iFrame" data="'.$src.'" type="text/html" style="border: 0 none; overflow: none; width: 700px; height: 200px; background-color: #111111;">'.$id.' is not a valid object target</object>'; | |
} | |
else | |
{ | |
return '<iframe id="'.$id.'iFrame" src="'.$src.'" type="text/html" style="border: 0px 0px 0px 0px none; overflow: none; width: 700px; height: 200px; background-color: #111111;">No iFrame-support</iframe>'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment