Profile
Achievement
iridium's Recent Snippets
- All /
« 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
1068
posted 12 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
1108
posted 15 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
1758
posted 15 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
626
posted 15 years ago by iridium