Archive for the 'Programming' Category
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 [...]
August 29th, 2010 | Posted in Programming | 2 Comments
Needed a way to add a CSS file with JavaScript, so I went out a-Googling like I normally do. Problem is everything I found either worked in Internet Explorer and not in FireFox or the other way around. Nothing I found worked in both. So I hacked together a function of my own. Should have [...]
August 14th, 2010 | Posted in Internet, Programming | No Comments
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 [...]
July 27th, 2010 | Posted in Programming | No Comments
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 [...]
July 24th, 2010 | Posted in Programming | 1 Comment
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.
PLAIN TEXT
PHP:
echo [...]
July 23rd, 2010 | Posted in Programming | 1 Comment
For the better part of the last couple of days I've been trying to figure out why Safari was not allowing me to click on links. Aside from an annoyance, it's not good to have clients complaining...
June 7th, 2010 | Posted in Programming | No Comments
Sometimes IE just irritates me. Ok, pretty much anytime I'm working on a web site. Especially when it involves Javascript or DOM.
For the past couple of hours I've been scouring the internet looking for a solution to the prototype method setStyle not working in IE8. I was getting an 'Object [...]
April 2nd, 2010 | Posted in Programming | 1 Comment
I've been looking for an excuse to play around with scripting in Photoshop. Today I found one. I came across a series of actions that rounded off the corners of an image to get it ready for uploading to a web site. The problem is that it was a series of actions. [...]
March 20th, 2010 | Posted in Programming | No Comments
A while back Google added event tracking to Analytics so you could keep track of Javascript and Flash events. Pretty cool feature.
Being the stat junkie that I wanted to use this to keep track of outgoing clicks on a photography forum of mine. But I didn't want to have to go through every link prior [...]
March 19th, 2010 | Posted in Programming | No Comments
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 back [...]
August 16th, 2009 | Posted in Blogging, Programming | 2 Comments