|
Table of Contents
This page contains odd bits and pieces. Test PagesPHP CounterThis PHP script (written by yourstruly): <?php header("Content-type: image/png"); //Load the image $im = imagecreatefrompng('pimps.png'); //has a URL been mentioned? if(isset($_REQUEST['url'])){ $url = $_REQUEST['url']; $url = str_replace('/','_',$url); $url = str_replace('~','_',$url); $url = str_replace('?','_',$url); $url = str_replace('&','_',$url); $url = str_replace('.','_',$url); $url = str_replace('%','_',$url); $url = str_replace(':','_',$url); $filename = "urls/$url"; $string = ''; //Does the file exist? if (file_exists($filename)) { $hits = file($filename); $hits[0] ++; $string = "$hits[0]"; } else { $string = "1"; } $fp = fopen($filename , "w"); fputs($fp , $string); fclose($fp); $white = imagecolorallocate($im, 255, 255, 255); imagestring ($im, 1, 40, 4, $string, $white); } imagepng($im); imagedestroy($im); ?> IR Group ListThe three most useful books for doing a PhDNone of these are accademic. 1. The Not So Short Introduction to L T E X2 ε2. Eats, Shoots & Leaves3. Getting things doneASCII Pikachu(\___/) (= ‘.’=) (”)__(”) 140 Character Web AppHaving been inspired by the 140 character webapp challenge, I’ve attempted my own: <?php if($_GET['a']){$x=file(a);header("Location:$x[0]");fwrite(fopen(a,'w'),$_GET['a']);}?><form><input name=a><input type="submit"></form> Layed out slightly more readably: <?php if($_GET['a']){ $x=file(a); header("Location:$x[0]"); fwrite(fopen(a,'w'),$_GET['a']); } ?> <form> <input name=a> <input type="submit"> </form> Hosted at Numenore simply type in a URL, click submit and get sent to the page the previous person left for you. |