Archive for the tag 'php'

WordPress plugin: Conversation Viewer

First off, I have to say that I can really only take credit for about 10% of the code in this plugin, if that. I really can’t even take credit for the idea. And let me also come out and say that I am in no way any sort of PHP genius. I’m sure there are things that could be done better in this plugin, but this works for me. So, with all that out of the way, the idea for this came from Dunstan, and the majority of the code came from Aaron Schaefer’s Code Viewer plugin.
Read more »

Converting latitude/longitude with PHP

Ok, so what I’m about to show you is hardly rocket science. It is however, the first chunk of math I’ve done with PHP that is more than 2 lines long. So I figured why not, I’ll post it. I was coding up a USGS gaging station finder and realized that I had latitude/longitude values for the stations in decimal degrees (such as 32.872352° latitude, -91.867904° longitude), but couldn’t I convert these to degrees/minutes/seconds (such as 32° 52’ 20.47” latitude, 91° 52’ 4.45” longitude)? Surely I could figure this out.
Read more »

PHP/CSS versus ASP/tables

For the past few days, I have been tinkering around with PHP while rebuilding our site at work. I initially did everything in tables and ASP back last year sometime. Just some small stuff, nothing major.
Read more »

Apache/PHP local install

Today on my Windoze XP machine at work, I installed Apache 2.0.5 and PHP 5.0.1 locally for development. Previously, I had a mapped drive to our server, and I would copy/paste files from my machine to the server, then reload the page in the browser. Repeat 5,895 times. Okay, so maybe not that many times, but it was a pain. Actually, the current version of our lab site (our server is currently “in repair” so I can’t give you a link to it) I did in *cough* ASP *cough*, because I didn’t know PHP at the time and needed to get some Access databases on the web quickly. Now, however, in the coming months I plan on migrating all of the Access data to MySQL and powering it all with PHP (as I learn it). Soooo, I decided to install Apache and PHP today. I’ve heard horror stories of installing server packages and getting it all configured. I found this tutorial that helped alot. I did the Apache binary installer and PHP zip package installation, tinkered with the Apache httpd.conf file settings and some Windoze system file settings, and by 9:30 this morning, I was parsing PHP locally. It was alot easier than I thought it would be, especially since this was my first attempt at installing/running a server. All I can say now is why the hell didn’t I do this earlier?