By

Backing up MySQL Databases with PowerShell

I created this PowerShell utility to backup MySQL databases to a path. You execute it in by right clicking on the script in Windows Explorer and select Run with PowerShell or run it with the PowerShell command line:

./MySQL_Backup.ps1

The script can be downloaded here: MySQL_Backup.ps1.

By

Redirecting Pages in HTML 5

Internet Explorer 10 on Windows 8/2012 has compatibility problems in using the Refresh meta tag to redirect pages to a new URL. You can get around this by including a JavaScript redirect and an HTML link in case that doesn’t work.

Replace all 3 instances of www.website.com below with the URL that you want to redirect to.

— HTML code below —

<!doctype html>
<html>
  <head>
    <title>Page Title</title>
    <meta http-equiv="Refresh" content="0; url=http://www.website.com">

    <!-- If the meta tag doesn't work, try JavaScript to redirect. -->
 
    <script type="text/javascript">
      window.location.href = "http://www.website.com"
    </script>
  </head>

  <body>
    <!-- If JavaScript doesn't work, give a link to click on to redirect. -->
 
    <p>If you are not redirected automatically, click <a href='http://www.website.com'>here</a>.</p>
  </body>
</html>

By

How to Fix ReCAPTCHA Positioning Error in Joomla

Adding a captcha to a form is very easy with Google ReCAPTCHA. It only takes a few lines of code after you register your domain on the ReCAPTCHA site.

The problem that I discovered is that the captcha appears in Joomla at the very top of the page when it is used on a form. Its being positioned there with CSS in the joomla.css in the templates/css folder. You can modify the code to position it use relative instead of absolute references, or better still just comment out the line and position the captcha in your HTML page.

Search for recaptcha_widget_div in joomla.css and you’ll find something similar to the following code:

/* Compatibility */
#recaptcha_widget_div {position: absolute;top: -140px;}

Comment out the recapthca_widget_div line and the captcha will appear where you define it.

By

How To Iterate Through an Associated Array in PHP

The following code will allow you to iterate through any associated array in PHP. The keys in the array are displayed in a bold font.


foreach ($list as $i => $values)
{
foreach ($values as $key => $value)
echo "$key => $value";

echo "
";
}

By

How to Update .NET Windows Controls at Runtime

If you change the value of a control on Windows .NET form during runtime, it may not be updated with the changes. The following code should change the Text property of ToolStripStatusLabel, but it doesn’t work while its processing in the middle of its function. When its the last command in the function, it will change the label."

label_Folder.Text = "Converting documents to PDF.";

If additional code follows the label_Folder statement, it may not update the Text property. You can force the property to update with the Refresh method:

label_Folder.Text = "Converting documents to PDF.";
label_Folder.Refresh ();

The label will then be updated with the new content. If your using a ToolStripStatusLabel, you don’t have the option of using Refresh this way, i.e.

toolStripStatusLabel_ProcessingStatus.Text = "Status: 12 of 19 documents processed.";
toolStripStatusLabel_ProcessingStatus.Refresh ();

Instead, use this.Refresh () to force an update:

toolStripStatusLabel_ProcessingStatus.Text = "Status: 12 of 19 documents processed.";
this.Refresh ();