Created
May 8, 2013 01:52
-
-
Save neopunisher/5537638 to your computer and use it in GitHub Desktop.
Make php echo a 1x1 transparent gif in a few different ways
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
header( 'Content-type: image/gif' ); | |
# The transparent, beacon image | |
echo chr(71).chr(73).chr(70).chr(56).chr(57).chr(97). | |
chr(1).chr(0).chr(1).chr(0).chr(128).chr(0). | |
chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).chr(0). | |
chr(33).chr(249).chr(4).chr(1).chr(0).chr(0). | |
chr(0).chr(0).chr(44).chr(0).chr(0).chr(0).chr(0). | |
chr(1).chr(0).chr(1).chr(0).chr(0).chr(2).chr(2). | |
chr(68).chr(1).chr(0).chr(59); |
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
header("Content-type: image/gif"); | |
header("Content-length: 43"); | |
$fp = fopen("php://output","wb"); | |
fwrite($fp,"GIF89a\x01\x00\x01\x00\x80\x00\x00\xFF\xFF",15); | |
fwrite($fp,"\xFF\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00",12); | |
fwrite($fp,"\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02",12); | |
fwrite($fp,"\x44\x01\x00\x3B",4); | |
fclose($fp); |
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
header("Content-Type: image/gif"); | |
header("Content-Length: 49"); | |
echo pack('H*', | |
'47494638396101000100910000000000ffffffff' | |
.'ffff00000021f90405140002002c000000000100' | |
.'01000002025401003b' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment