Create directories with PHP

I take a lot of pictures and pretty much take a picture every day. I keep them categorized by year and month. So each each month I end of making at least one folder for each day. Well, why not just create a PHP script to do this for me. So I did.

The following script does a few things.

First, it creates the HTML <option> form elements . I created a function that creates an array with all of the months listed. Each month has a corresponding index (1-12).

I also set a variable for “selected”, which will be added to the option element for the current month. Usually I make these folders soon after the first of the month, so the selected month will always be the current month. I will be able to of course choose any month from the selection list.

I also set a variable to hold the index. This will be using as the script loops through the array of months and will add the “selected” attribute when the index and current month are the same.

That same loop is creating the “select” list and each option for each month in the year. Again, this is done by looping through the array that holds all 12 months.

The folders are created when the form with the section list is submitted. A “while” loop creates a folder for each day of the month.

function Options()
    $current_month = date("m");
    $month[1] = "Jan";
    $month[2] = "Feb";
    $month[3] = "March";
    $month[4] = "April";
    $month[5] = "May";
    $month[6] = "June";
    $month[7] = "July";
    $month[8] = "Aug";
    $month[9] = "Sept";
    $month[10] = "Oct";
    $month[11] = "Nov";
    $month[12] = "Dec";
    $selected = 'selected';
    $index = 0;

    echo '<select id="month" name="month">';
    foreach ($month as $value)
        $index = ++$index;
        if($current_month == $index){$selected = 'selected';}else{$selected = '';}
         echo '<option value="'.$index.'" '.$selected.'>'.$value.'</option>';
    echo '</select>';
$current_year = date("Y");
$current_month = date("m");

    $x = 1;
    $selected_month = $_POST['month'];
    $Num_days_current_month = cal_days_in_month(CAL_GREGORIAN,$selected_month,$current_year);
    while($x <= $Num_days_current_month)

Thank you for reading!

Android Gmail App – underline links

According to Litmus, the following email clients do not, by default, underline links. You must add “text-decoration:underline”.

Gmail App (Android 7.1)
Gmail App (Android 8.0)
Gmail App IMAP (Android 6.0)

Thank you for reading!

How to not track an individual link in a Salesforce email

To track clicks in a SalesForce email template, you add the proprietary “custom” tag in the body of your HTML.

<custom name=”opencounter” type=”tracking”>

This will track all links.

But, what if you do not want to track individual links?

You can create a variable and assign the complete “a” tag to it, including the clickable text, and the closing “</a>”.

SET @Targetbase = ‘<a href=””>Do not track this link to Targetbase</a>’

In the body of the email, you just render the print the value of the variable.


Thank you for reading!