Categories
WordPress

Changing your WordPress Database Table Prefix

An article at BlogSecurity.net points us to a plug-in that will change the table-prefix of the MySQL database tables used by your blog.

This step contributes to the security of your blog by letting you swap the default (and thus obvious) 'wp_' table prefix for something obscure that a hacker could not guess at.

Remember that if your WP installation does not have error reporting turned off an attacker may yet be able to force your installation to reveal critical information by forcing an error and reading sensitive database information from the error messages.

Categories
PHP

Capturing the filename from a path in PHP

When you want to isolate the base filename from a path string, this is the way to do it:

[sourcecode language='php']
$path = "/home/project/folder/mypage.php";
$file = basename($path);          // $file is "mypage.php"
$file = basename($path, ".php");      // $file is "mypage"
[/sourcecode]

See dirname() and pathinfo() for related information.

Categories
PHP

Stripping the Query String from a URL in PHP

[sourcecode language='php']
list($shorturl) = explode('?','http://www.website.com.com?page=7');
echo $shorturl;
[/sourcecode]

Categories
Operating Systems

Just-In-Time debugger errors after uninstalling Visual Studio

Uninstalling Visual Studio can leave your system struggling with  Just-In-Time debugger errors that can prevent applications from starting.

To resolve it, try deleting the following registry keys.

The usual warnings about editing the registry apply; if you don't understand the risks, don't do it.

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
  •  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
Categories
PHP

Arrays in PHP

Some day I'll get around do writing some stuff on arrays in PHP.  In the meantime, here are some links to another site with some outdated but still quite useful information on arrays in PHP.