iridium


Member since 01/03/2009

Name: Ben Hodgson

Location: London

Website: http://benhodgson.net

4 snippets

275 profile views

2 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet

iridium's Recent Snippets



« Prev 1 Next »
This function will detect the orientation (portrait/landscape) of an iOS device and set the body class to either portrait or landscape, as well as providing a global variable for use elsewhere in your JS. If you require multiple classes on your bo...
3 103 posted 8 years ago by iridium
Generates an options list of years for a select box, going from current year backwards through the number of years specified in the first variable. Useful for birthday fields on signup forms. eg. 2009, 2008, 2007, 2006 ... 1912, 1911, 1910, 190...
3 140 posted 11 years ago by iridium
Return just the Apache version number of your server, and operating system, from $_SERVER['SERVER_SOFTWARE'] Example: print ('Apache Version: ' . apacheversion()); will return something along the lines of... "Apache Version: 2.2.10 (Unix...
1 216 posted 11 years ago by iridium
Simple but useful function for getting a single piece of data from a database and placing it straight into a variable. Example: $variable = one_result("SELECT columnOne FROM table WHERE columnTwo=whatever"); This would insert the value of colu...
1 55 posted 11 years ago by iridium
« Prev 1 Next »