Dodona gives you answers

Archive for August 26th, 2008

How do I verify my blog on Google webmaster tools?

leave a comment »

  1. Write a new Page (not Post).
  2. In the title field, paste the exact code that you get from Google Webmaster Tools option “Upload an HTML file” (this is the verification method you have to choose).
  3. Publish the new page on your WordPress blog.
  4. Ask Google to verify your WordPress blog.
  5. After Google has verified your blog, you can delete the page.

Status: Tested it, works (nice!)

Link: Original post of this tutorial

Written by lutsen

August 26, 2008 at 2:34 pm

Posted in Web

How can I check if PHP on my webserver supports sessions?

leave a comment »

The simplest way to check if sessions are enabled on your PHP installation is with the phpinfo(); command:

<?php phpinfo(); ?>

This generates a table with an overview of all PHP settings on your server.

To check if sessions really work you can use this code:

// Start Session
// Show banner
echo '<b>Session Support Checker</b><hr />';
// Check if the page has been reloaded
if(!isset($_GET['reload']) OR $_GET['reload'] != 'true') {
   // Set the message
   $_SESSION['MESSAGE'] = 'Session support enabled!<br />';
   // Give user link to check
   echo '<a href="?reload=true">Click HERE</a> to check for PHP Session Support.<br />';
} else {
   // Check if the message has been carried on in the reload
   if(isset($_SESSION['MESSAGE'])) {
      echo $_SESSION['MESSAGE'];
   } else {
      echo 'Sorry, it appears session support is not enabled, or you PHP version is to old. <a href="?reload=false">Click HERE</a> to go back.<br />';

Written by lutsen

August 26, 2008 at 2:21 pm

Posted in PHP, Web

What is a good Mac FTP client?

leave a comment »

My personal favorite is Transmit. It’s not free, but not expensive either ($29.95). A free (and open source) alternative is Cyberduck. Another interesting free option is FireFTP, which is not a standalone FTP client, but a Firefox plug-in.

Transmit: Tested it, like it a lot
Cyberduck: Tested it, works
FireFTP: Tested it, works




Written by lutsen

August 26, 2008 at 2:05 pm

Posted in Mac, Web

How can I remove a directory from my webserver?

leave a comment »

The most obvious way would be to use an FTP client. But sometimes I run into the problem that directories, created with for example a CMS system that runs on the server, have another owner (namely the script that created them). That way it may happen that my FTP client doesn’t have enough rights to remove the directory. If this happens after I deleted the server-side script that created the directory, I am stuck with a directory I can’t get rid of.

This is where the PHP code below comes in handy. It removes a directory and its contents from the server. Because in situations as described above it usually has the same rights as the script that created te directory, it is likely to succeed where your FTP client might fail.

NOTE: be careful not to leave the script on your server after you have used it for obvious reasons…

function removeDir($path) {
   // Add trailing slash to $path if one is not there
   if (substr($path, -1, 1) != "/") {
      $path .= "/";
   $normal_files = glob($path . "*");
   $hidden_files = glob($path . "\.?*");
   $all_files = array_merge($normal_files, $hidden_files);
   foreach ($all_files as $file) {
      // Skip pseudo links to current and parent dirs (./ and ../).
      if (preg_match("/(\.|\.\.)$/", $file)) continue;
      if (is_file($file) === TRUE) {
         // Remove each file in this Directory
         echo "Removed File: " . $file . "<br>";
      } else if (is_dir($file) === TRUE) {
         // If this Directory contains a Subdirectory, run this Function on it
   // Remove Directory once Files have been removed (If Exists)
   if (is_dir($path) === TRUE) {
      echo "<br>Removed Directory: " . $path . "<br><br>";
// To remove a dir:

Written by lutsen

August 26, 2008 at 1:44 pm

Posted in PHP, Web