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 | |
function tiny_url($url) { | |
return file_get_contents('http://tinyurl.com/api-create.php?url=' . $url); | |
} | |
$json = json_decode(file_get_contents('php://input')); | |
echo tiny_url($json->url); | |
/* basic jQuery usage: | |
$.post('https://foo.bar/tiny-url-api.php', JSON.stringify({url: url_2b_shortened})) |
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
<!DOCTYPE html> | |
<!-- Contrbuted by GS --> | |
<html><head></head><body> | |
<?php | |
while (list($var,$value) = each ($_SERVER)) { | |
echo "$var => $value <br />"; | |
} | |
?> | |
</body></html> |
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
<!DOCTYPE html> | |
<!-- Contrbuted by GS --> | |
<html><head></head><body> | |
<?php | |
while (list($var,$value) = each ($_ENV)) { | |
echo "$var => $value <br />"; | |
} | |
?> | |
</body></html> |
NewerOlder