My 2012 Resolutions

58709go2rx134on 300x199 My 2012 ResolutionsI honestly can’t remember the last time I actually wanted to make a New Year’s resolution. However, I am wanting to better my life and others around me so here it is; making it 100% public for the first time.

First: Eat out less and stop buying microwaveable/prepackaged frozen foods.
Second: Work out more. (The typical New Year’s Resolution, right?)
Third: Take care of myself and things I care about first and make more time for these things.
Fourth: Take more pictures! It’s something I enjoy, and I need to take advantage of it.

I know it’s well after the new year, but I still want these publicly known so that friends and family can hold me accountable.

Image: Idea go / FreeDigitalPhotos.net

I am a failure…

There are two Michael Jordan quotes that truly are amazing. Actually, he has quite a few quotes on this topic; the two I am going to focus on are some of my favorites.

I’ve missed more than 9000 shots in my career. I’ve lost almost 300 games. 26 times, I’ve been trusted to take the game winning shot and missed. I’ve failed over and over and over again in my life. And that is why I succeed.- Michael Jordan

Failure leads to Success

I recently wrote Taking Risks; Meeting Opportunities because of my own life experiences. I’ve been too afraid at times to move on; mainly because I’m afraid of failure myself. However, should you be afraid to fail? Or simply learn from those around you and the mistakes that you’ve made in your life.

The best example I can currently think of involves Steve Jobs. We all know of the risks he took in the computer and entertainment industries, but amidst his success there was also failure.

Jobs failed better than anyone else in Silicon Valley, maybe better than anyone in corporate America. By that I mean Jobs did what only the greatest entrepreneurs can do: learn from their failures. I don’t mean learn from their mistakes. I mean learn from their abject, humiliating, bonehead, epic fails. Celebrating Steve Jobs’ Failures

The moral of this post is to accept failure. Own up to your failures and most importantly never stop learning. As soon as you give up on learning; you are abandoning success too.

And just because I can, I’ll leave you with one more MJ quote:

I can accept failure, everyone fails at something. But I can’t accept not trying.

Facebook Contact Forms with AJAX and PHP

While working today, I was having an issue finding information on how to add a lead capture form on our Facebook Page. Luckily I stumbled across this amazing post! Submitting a Contact Form via AJAX From Your Facebook Page

However, this solution didn’t completely work out of the box so I had to pull some knowledge in from working on previous PHP Forms.

The Facebook Code

Both of these pieces of code should be placed on your Static HTML Page/Tab

The Form

1
2
3
4
5
6
7
8
9
10
11
12
<form action="http://YOURWEBSITE.com/form_submit.php" method="post">
     <p>
          <label for="name">Name:</label>
          <input type="text" name="name" id="name" />
     </p>
     <p>
          <label for="email">Email:</label>
          <input type="text" name="email" id="email" />
     </p>
     <button type="submit" onclick="return submitAjaxForm();">Submit</button>
     <p id="ajaxMessage"></p>
</form>

The AJAX

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<script><!--
function submitAjaxForm()
{
    // declare a new FBJS AJAX object
    var ajax = new Ajax();
    ajax.responseType = Ajax.FBML;
    // define a callback to handle the response from the server
    ajax.ondone = function(data)
    {
        document.getElementById('ajaxMessage').setInnerFBML(data);
    }
    // let the user know we're sending the data
    document.getElementById('ajaxMessage').setInnerXHTML('Submitting your information, please wait...');
    // collect field values
    var queryParams = { 'name' : document.getElementById('name').getValue(), 'email' : document.getElementById('email').getValue() };
    ajax.post('http://mywebsite.com/form_submit.php', queryParams);
    return false;
}
//--></script>

Please note that either of these can be edited to add or remove form fields. You just need to check to make sure the queryParams are updated in the Ajax as they are queried by the “getElementById” function

The PHP

I don’t know any other scripting languages at the moment and don’t have a desire to learn others at this point so everything else was done in PHP. The default PHP script can be found at the link above. This modified script will allow you to send an email using the PHP Mail function.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// Set Default Timezone to Indianapolis for Submission Date/Time
    date_default_timezone_set('America/Indianapolis');
// Get User Content from the Form
    $name = stripslashes($_POST['name']);
    $email = stripslashes($_POST['email']);
    $phone = stripslashes($_POST['phone']);
    $address = stripslashes($_POST['address']);
    $products = stripslashes($_POST['product']);
// Set Date for when Submission was Sent
    $date = date('F d, Y @ h:i a', time());

// Email headers and subject information
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //HTML Content Type
    $headers .= 'From: ' . $name . '<' . $email . '>'; //Who's it from? The person that filled out the form!
        $subject = 'YOUR EMAIL SUBJECT';
    $recipient = 'You@YourDomain.com';
     
    $msg =          "<strong>Submission Info:</strong>" .
            "<br /><br />" .
            "<strong>Submitted: </strong>" . $date . "<br />" .
            "<strong>Name: </strong>" . $name . "<br />" .
            "<strong>Phone: </strong>" . $phone . "<br />" .
            "<strong>Email: </strong>" . $email . "<br />" .
            "<strong>Address: </strong>" . $address . "<br />" .
            "<strong>Product: </strong>" . $products ."<br />" .
            "<strong>How they Found Us: </strong>Facebook";

    //Mail $msg to the recipient on the form
      if (mail($recipient, $subject, $msg, $headers))
         {
            //Output a confirmation that the email has been sent
            echo "<p><strong>" . $name . " Your Entry has been submitted. </strong><p>";
        }
     else //Error Message if problems arise
     {
            echo "<p>Message failed to send.";
     }
?>

This is the code that I used. I plan on updating to counter an empty form. But haven’t had the time to do that as of yet. Let me know if you have any thoughts on how to improve a lead capture form on a Facebook page! Please note that I did NOT write this code and all credit should go to the original author George Huger and his post Submitting a Contact Form via AJAX From Your Facebook Page

PHP Code: First and Last Day of Month

As I was writing some code today, I wanted a quick way to display the end of the month Date and came across this little snippet on Justin-Cook.com. It’s a post from 2009, but it still does what I need it to!

1
2
3
4
5
6
function firstOfMonth() {
return date("m/d/Y", strtotime(date('m').'/01/'.date('Y').' 00:00:00'));
}
function lastOfMonth() {
return date("m/d/Y", strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
 }

The end date function goes to the NEXT month and subtracts a day to get the last day of the current month. Quite a nice piece of code if you have time sensitive offers like we do at Unique.

Orignal post: Get the first & last day of the month with PHP

Taking Risks; Meeting Opportunity

Recently I was talking to an online acquaintance regarding the process of making tough decisions. My question to you is why are you afraid to take the risks that will make you happy?

People are Safe

You know what will make you happy don’t you? So why aren’t you doing everything you can to do it? I’ve seen in my life that I need encouragement do try something different. When I saw the coaching position open I was hesitant to apply, why? I knew that I had the knowledge of the sport and a want to coach. I was afraid of change and rejection.

In my job search after college I applied to numerous jobs over a ten month period. I had one interview and one job offer, it’s the position I hold now. Rejection, even after a year of employment, was still fresh in my mind. I really wanted to hold on to the job I had, and not risk losing it, especially since it pays my bills. However, I figured out that it was possible for the jobs to complement one another and I wanted to do something else with my time.

“The person who risks nothing, does nothing, has nothing, is nothing, and becomes nothing. He may avoid suffering and sorrow, but he simply cannot learn and feel and change and grow and love and live.”

- Leo F. Buscaglia

Breaking the Cycle

So how do you break the chain on a risk-less life? You take risks! Go do something you wouldn’t normally do. Apply for that dream job that you aren’t qualified for. The worst that anyone can say to you is “no thanks.” You might be afraid of rejection; but trust me, you’ll feel even more satisfied when you prove yourself wrong.

And one day, it will pay off. You will apply for the job and get it.

Tips to Succeed

If you want sure-fire ways to succeed in this, well send me the list too so we’ll both know. I do, however, have some tips of how to successfully take risks and feel rewarded.

  1. Start Small – Take small calculated risks to get warmed up to the big stuff. There’s no reason to over compensate for your lack of risk taking before.
  2. Be Confident – There’s nothing better than seeing someone who is confident in their skill sets. Believe in what you know and trust what you are doing. Do you think I knew anything about coaching going in? Nope, but I did have knowledge of the sport, how to do the technique and I was confident in relaying what I know to the group.
  3. Don’t Let Fear Guide You – If you are smart and confident about the risks you are taking and fear will no longer be a factor. Just make sure you aren’t stepping too far out of your comfort zone too fast or you might take steps backwards. Jumping too far ahead will ruin your risk taking abilities in the future.
So what are your thoughts? Why are you afraid to take risks? What tips would you add to people who are afraid to take risks? Input is always welcome and appreciated…
 Taking Risks; Meeting Opportunity