Archive for September 2011

Chimney Rock State Park

Published on September 30, 2011

I’ve just posted the fourth album from my recent trip to the mountains. This set showcases Chimney Rock State Park, which is a fantastic place to visit. Though it costs money to get in, the views and hikes are worth it. I’ve got one more photo album to post from this small vacation trip to the Asheville area; it should show up within the next week or so.

Whitewater Falls Photos

Published on September 22, 2011

I’ve just posted the third of five photo albums from my recent trip to the mountains. This time around, it’s a set from a short visit to Whitewater Falls, the highest waterfall east of the Rocky Mountains (though that term is debatable). Visiting the park costs $2, but the views are worth it, in my opinion. Definitely check it out if you’re ever in the southwestern mountains of our state.

Getting Form Data With PHP

Published on September 19, 2011

A couple of years ago, I blogged about two helper functions I wrote to get HTML form data in PHP: getGet and getPost. These functions do a pretty good job, but I have since replaced them with a single function: getData. Seeing as I haven’t discussed it yet, I thought I would do so today. First, here’s the function in its entirety:


/**
 * Obtains the specified field from either the $_GET or $_POST arrays
 * ($_GET always has higher priority using this function). If the value
 * is a simple scalar, HTML tags are stripped and whitespace is trimmed.
 * Otherwise, nothing is done, and the array reference is passed back.
 * 
 * @return The value from the superglobal array, or null if it's not present
 * 
 * @param $key (Required) The associative array key to query in either
 * the $_GET or $_POST superglobal
 */
function getData($key)
{
    if(isset($_GET[$key]))
    {
        if(is_array($_GET[$key]))
            return $_GET[$key];
        else
            return (strip_tags(trim($_GET[$key])));
    }
    else if(isset($_POST[$key]))
    {
        if(is_array($_POST[$key]))
            return $_POST[$key];
        else
            return (strip_tags(trim($_POST[$key])));
    }
    else
        return null;
}

Using this function prevents me from having to do two checks for data, one in $_GET and one in $_POST, and so reduces my code’s footprint. I made the decision to make $_GET the tightest binding search location, but feel free to change that if you like.

As you can see, I first test to see if the given key points to an array in each location. If it is an array, I do nothing but pass the reference along. This is very important to note. I’ve thought about building in functionality to trim and strip tags on the array’s values, but I figure it should be left up to the user of this function to do that work. Be sure to sanitize any arrays that this function passes back (I’ve been bitten before by forgetting to do this).

If the given key isn’t found in either the $_GET or $_POST superglobals, I return null. Thus, a simple if(empty()) test can determine whether or not a value has been provided, which is generally all you care about with form submissions. An is_null() test could also be performed if you so desire. This function has made handling form submissions way easier in my various work with PHP, and it’s one tool that’s worth having in your toolbox.

Gorges State Park

Published on September 18, 2011

I’ve just posted some photos from Gorges State Park, the westernmost state park in North Carolina. This park is also one of the newest; visitor facilities are currently under construction. That being said, the views and hikes from this park are fantastic. I will certainly make an effort to return to this park in the future; this is one that definitely warrants multiple visits.

South Mountains State Park

Published on September 13, 2011

Late last week, I stopped at South Mountains State Park on my way to the Asheville area for some vacation. The park is located south of Morganton, NC, and has terrific hiking trails and beautiful scenery. High Shoals Falls, an 80-foot high waterfall, is located at the park. Knowing this, I took my tripod along, and got some nicer-than-usual photos in the process. If you’re ever in that particular area of North Carolina, I highly recommend a visit to this park. This is one I would love to return to!

Don’t Always Trust Auto White Balance

Published on September 11, 2011

As I mentioned in my previous post, I learned two photography lessons on my recent trip to the mountains of North Carolina. Today, I will be covering the second lesson I learned. In short, never fully trust your camera’s automatic white balance setting. While shooting under cloudy conditions, I found that the automatic setting resulted in photos that were way too cool in color, resulting in inaccurate representations of what my eye saw. Here’s a great example from my visit to Mount Mitchell State Park (a wonderful place, I might add):

Automatic White Balance Scene
Photograph taken with automatic white balance

Compare the automatic white balance photo with the following one, which was taken with manual white balance (on the “Cloudy” setting):

Manual White Balance Scene
Photograph taken with manual (Cloudy) white balance

Note how this second image is warmer in color, with richer greens and reds. This second image is much closer to what I really saw, and the color difference was enough to be apparent in the little LCD display on my camera. The morning I visited the park, weather conditions were definitely cloudy. It’s interesting then that the automatic white balance didn’t pick up on those conditions better than it did.

One obvious solution to this problem is to shoot in RAW mode (assuming your camera supports it). My camera does not support RAW, and I’m not entirely sure that the additional post-processing work necessary with RAW photos is worth it (though I’m sure plenty of pros would disagree). As I have learned, you’re probably better off manually setting your white balance for a given scene. Just don’t forget to change it each time you go on a shoot. You wouldn’t want to shoot in “Cloudy” mode on a bright, sunny day.

Tripods Are Useful Tools

Published on September 10, 2011

I learned two very important photography lessons during my recent vacation to the southwestern mountains of North Carolina. Today I will cover one of those lessons, and I’ll get to the other one in a future post. As you might have guessed from this post’s title, the first lesson involves a tripod.

In my previous outings to the various state parks here in North Carolina, I’ve never carried a tripod with me. On a bright sunny day, it’s typically a tool I feel that I don’t need; lots of light, a steady hand, and my camera’s image stabilization feature help me out. On cloudy days, however, I inevitably end up with a load of blurred shots, especially when in a heavily forested area. On this particular trip to the mountains, I knew I would be shooting a number of waterfalls, so I was willing to haul my tripod down the trail with me.

Since I already had the tripod with me, I found that I used it for way more than the waterfall shots I had intended. Wow, what a difference it made! Instead of lots of blurred shots, the vast majority of my photos are keepers this time around, thanks to this handy tool. I’ve also learned a few things about the type of tripod I want in the future:

  1. It should be light
  2. It should have a ball head
  3. The adjustable leg locks should be sturdy

My current tripod is a tad bulky, and the multiple controls are a bother to work with. A multidimensional bubble level for my camera’s hot shoe connector would also be useful.

In short, if you’re planning a photo shoot in a forested area, or you’re shooting on a cloudy day, make an effort to carry a tripod along with you. Your end results will justify the extra effort of lugging extra gear down the trail. As an added bonus, carrying a tripod will pique people’s curiosity. I struck up more conversations with random people about photography on this trip than I’ve ever done previously. It’s a lesson I’ll remember for a long time.

Copyright © 2004-2018 Jonah Bishop. Hosted by DreamHost.