PHP

fuser process using cpu useage 100%+ in ubuntu 11.1x

php5 cronjob fuser designed to clean out php sessions is eating the cpu on ubuntu boxes. This is the content of /etc/cron.d/php5 on 11.10: 09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s…

Read More...

PHP and Google TTS (text to speech) solution writes MP3 files. Playback via HTML5 audio player

I wrote a simple solution that takes text (var or input) and speaks it using your browsers built in HTML5 audio player. Source code available Demo Here: http://stuffthatspins.com/stuff/php-TTS/

Read More...

Best SVN / CVS client plus project and bug tracking solution

I’ve tried a ton. This is the one package that will keep your code moving forward and deliver your project on time

Read More...

PHP function to sort multidimensional arrays

nice little function to sort php multidimensional arrays: /////////////////////////////////////// /// SORT MULTIDIMENSIONAL ARRAYS //// /////////////////////////////////////// function subval_sort($a,$subkey) { foreach($a as $k=>$v) { $b[$k] = strtolower($v[$subkey]); } asort($b); foreach($b as $key=>$val) { $c[] = $a[$key]; } return $c; }

Read More...

remove “confirm form resubmission” with Google Chrome

so, do you get the annoying “confirm form resubmission” page when a user hits the back button or refresh using google chrome? simply change your form method from “post” to “get”. if you can put all your values in the url use the “get” method instead of “post” //remove post <form action=”index.php?load=SEARCH” method=”post”> //use get…

Read More...

Common PHP regex (regular expressions) for web developers

For many beginners, regular expressions seems to be hard to learn and use. In fact, they’re far less hard than you may think. Before we dive deep inside regexp with useful and reusable codes, let’s quickly see the basics: http://www.catswhocode.com/blog/15-php-regular-expressions-for-web-developers

Read More...

PHP + Javascript – limit characters in multiple text areas within same form

Javascript  <script language=”javascript” type=”text/javascript”> //http://www.phpfreaks.com/forums/javascript-help/%28solved%29-javascript-character-limit-with-multiple-textareas/ function checkTextArea(id,limit){ //alert (“id ” +id +” limit ” + limit); if (document.getElementById(id)){ //alert(“id ” + id); var txt = document.getElementById(id).value; if (txt.length>limit){ //alert (“reached text limit: ” + limit + ” characters”); document.getElementById(id).value = txt.substr(0,limit); } len = document.getElementById(id).value.length; //alert (“len: ” + len); //alert (“limit”); span_id = “counter”…

Read More...

PHP format datestamp

convert: 2011-01-05 09:48:49 to: January 05, 2011 09:01AM $datestamp = date(‘F d, Y h:mA’, strtotime($archive_row[‘archive_datestamp’])) ;

Read More...

php session cache limiter

Warning : session_start() [function.session-start ]: Cannot send session cache limiter – headers already sent (output started at XXXX note to self: somehow my page had a whitespace before the

Read More...

JQUERY issues with Google Chrome .ajax() doesn’t load

For the life of me I couldn’t figure out why my JQuery .ajax() call wouldn’t load in Google Chrome. Especially when it worked in Firefox, IE and Safari which I thought is based on the same WebKit browser. Anyhow, I found the issue to be in the data format AND having null vars. $.ajax({ type:…

Read More...

MCrypt PHP5 Ubuntu Install

Ubuntu: PHP mCrypt Installation mCrypt is an encryption program used on Linux systems. To install mCrypt for PHP5 on your Ubuntu Linux system: sudo apt-get install php5-mcrypt Then restart Apache with: sudo /etc/init.d/apache2 restart I needed to do this so that  phpMyAdmin would have mcrypt available. For more info about mcrypt, visit: Official site http://mcrypt.hellug.gr…

Read More...

history…

James E. O’Loughlin Jr. Education: 1987 Graduate Ceres High School California 1989 Graduate US Army Missile Guidance Technician Redstone Arsenal Alabama 1996 Graduate Miami University Oxford Ohio B.S. Art Education Work Experience: Architect, design and build ANY website using WebObjects and Java or PHP web application servers pulling data from SQL (OpenBase, MySQL or Oracle)…

Read More...

php ajax and jquery page…

http://www.queness.com/post/328/a-simple-ajax-driven-website-with-jqueryphp

Read More...

google maps v3

google maps v3examples:http://www.wolfpil.de/ wrapper:http://www.galengrover.com/ http://flightcrewcentral.com/includes/module_google_map_xml.php?airport_id=740 jqueryhttp://googlemaps.mayzes.org/ PHP http://code.google.com/p/php-google-map-api/

Read More...

PHP Ascii CAPTCHA using Figlet

i saw a cool captcha today using ascii art. it might not be the safest captcha but i like it. i found a php class that uses figlet (ascii fonts) to make the ascii. http://www.figlet.org/ there’s a database of about 75 fonts here really reminding me of the old BBS days. when i used to…

Read More...

clean and remove formatting from microsoft word text for HTML use

i put this tool on my bitsprocket.com site for users to use. really helpful when using the TinyMCE editor plugin

Read More...

PHP MySQL JQuery AJAX Checkbox Array Sample

so i needed to have a PHP / Jquery Checkbox sample that read and updated from MySQL db. combined a few different samples to come up with this guy… demo download

Read More...

php stuff today

http://codeigniter.com/   http://www.smashingmagazine.com/2009/01/20/50-extremely-useful-php-tools/  

Read More...

password protect directory in ubuntu plesk .htaccess .htpasswd

  so you want to password protect your apache directory so people can’t sneak a peek. you’ll need two files in your directory: .htaccess and .htpasswd .htaccess source AuthType Basic AuthName “restricted area” AuthUserFile /var/www/vhosts/YourDomain.com/httpdocs/.htpasswd require valid-user   AuthUserFile is the file path on your server to the .htpasswd file. on ubuntu + plesk 9…

Read More...

ascii text convertor…

make your text look like you were hooking up your BBS with some warez…   _____ _ __ __ _______ _ _ _____ _ / ____| | / _|/ _|__ __| | | | / ____| (_) | (___ | |_ _ _| |_| |_ | | | |__ __ _| |_| (___ _ __…

Read More...