How to change the MySQL password in MAMP

Posted by & filed under Computers & Internet.

Reinstalled MAMP last week because the version I was using didn’t have PHP 5.3 which I needed for a project I’m working on. Had to do some Googling to find the default password for MySQL and how to change. First, the default username is root and password is also root. To update to a password… Read more »

Trimming all members of an array in PHP

Posted by & filed under Programming.

Needed a quick way to go through and trim leading and trailing spaces off of a string array in PHP. I’ve used array_walk to do it before, but with the addition of anonymous functions it makes it a little quicker without having to do a separate function. Love those one line and done techniques.

htaccess to deny access, except for includes

Posted by & filed under Programming.

It’s usually a bad idea to allow php include files to be directly accessed. My general method is to either declare a constant in the index.php and check for that constant in the included file or make sure that the included file doesn’t match $_SERVER[‘REQUEST_URI’]. Sure, either of those work. But I came across a… Read more »

phpMailer – Could not instantiate mail function

Posted by & filed under Programming.

Had a client getting this error when trying to send emails last week and have now spent several hours on Google trying to find a solution. Biggest catch is that other scripts were able to send mail, so it seemed unlikely that it was the host. So I took the phpMailer class and uploaded it… Read more »

bit.ly and PHP

Posted by & filed under Programming.

Needed a quick and easy way to create a bit.ly URL for another site of mine. Google came through for me. David Walsh posted a short PHP function on his site that takes your bit.ly login, API key, and the URL to shorten and returns a nice, short bit.ly link. Link: http://davidwalsh.name/bitly-php Just put the… Read more »

Quick PHP wrapper for print_r

Posted by & filed under Programming.

Working on web apps I find myself using the print_r command a lot, and I mean a lot. It helps trace out what data is going where, and more often what’s not going where it’s supposed to. A few months ago I realized that I type this same bit of code way too often. Does… Read more »

Netbeans with multiple monitors

Posted by & filed under Computers & Internet.

How did I not try this before today? My normal method of needing two files open was to have the one I’m working on in Netbeans and the other in Notepad++ on separate monitors.  Turns out you can drag the tab of an open file outside of Netbeans and it becomes its own window. We’re… Read more »

How to wrap a SMF forum in WordPress

Posted by & filed under Blogging, Programming.

After spending the better part of yesterday getting a forum setup with the same layout as its parent WordPress site I thought I’d share a couple of tips along the way. And I picked a less efficient way, including wp-blog-header.php in the forum code, because it was far easier. At some point I may go… Read more »

WordPress – Redirecting to the first child page

Posted by & filed under Programming.

I’ve been redesigning the website for a web application I am writing.  The site uses WordPress because I wanted a blog section and wanted visitors to be able to easily leave comments on any page.  So the entire site is backed with WordPress with most of the content on pages rather than posts. One of… Read more »

Aptana on Vista 64bit – Black Screen

Posted by & filed under Programming.

I’ve been having issues with Aptana putting a huge black box over the code window on Vista 64.  And it seems many others are having the same issue as well, which is a shame because it’s an otherwise great program. It appears to have something to do with the preview tabs.  I could open up… Read more »