Archive for the ‘PHP’ Category

Convert Jpeg to ASCII with PHP

May 12th, 2010 by admin 1

<html>
<head>
<title>Ascii</title>
<style>
body{
line-height:1px;
font-size:1px;
}
</style>
</head>
<body>
<?php
function getext($filename) {
$pos = strrpos($filename,’.');
$str = substr($filename, $pos);
return $str;
}
if(!isset($_POST['submit'])){
?>
<form action="<?echo $_SERVER['PHP_SELF'];?>" method="post">
JPG img URL: <input type="text" name="image"><br>
<input type="submit" name="submit" value="Create">
</form>
<?
}else{
$image = $_POST['image'];
[...]

How to compress CSS with PHP

February 19th, 2010 by admin 0

Rather than creating a style.css create a styles.php with the following code:

<?php
ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " .
gmdate("D, d M Y H:i:s",
[...]

How to stop picscout crawling your website

February 19th, 2010 by admin 0

Picscout is a very clever spider which crawls websites for its clients (namely getty images) and looks for any stolen images. By posting this I am by no means condoning copyright infringement. However picscout uses a lot of bandwidth and generally strikes repeatedly. This is a very simple script as picscouts bot uses the User [...]