Category Archives: Web Development

Easy to use .htaccess file generator

0
Filed under Web Development
Tagged as , , , ,

I found this very cool .htaccess file generator on line: http://cooletips.de/htaccess/

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Help save MySQL from Oracle

0
Filed under Developement, Web Development
Tagged as , , ,

If you’re a PHP-MySQL developer, then you know & appreciate the freedom that these 2 open source applications have given us. What started out as a hobby many years ago, turned into one of the most widely used scripting languages on the internet.

Coupled with MySQL you have a very powerful set of tools to build just about any type of website. And they’re both free. But, now that Oracle is trying to acquire Sun, this could soon change. And I don’t think it will change for the better. Oracle is expensive, and MySQL is a threat to them. If they own Sun, then they wouldn’t need to keep MySQL active anymore. And this could be a catastrophe for many web developers, Open Source projects, and website owners. Joomla, Drupal, http://www.simplemachines.org/, phpList, WHMCS, vBulletin, Wordpress (what I use for this blog) to name but a few scripts all rely on MySQL.

“Monty Says” has an extended article on this matter, found here with more info on how to help with this problem. Please help support this cause.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Alternative to magic_quotes in PHP 5.3 and PHP6

0
Filed under PHP
Tagged as , , , , , ,

PHP 5.3 and PHP6 will discontinue the use of magic_quotes for security reasons, and this means that your website may, or already have, break if you still rely on magic_quotes_gpc.

Below is some code that will give you the same functionality as magic_quotes_gpc:

< ?php

function clear_magic_quotes()
{
if (get_magic_quotes_gpc()) {
/*
All these global variables are slash-encoded by default,
because magic_quotes_gpc is set by default!
(And magic_quotes_gpc affects more than just $_GET, $_POST, and $_COOKIE)
*/
$_SERVER = stripslashes_array($_SERVER);
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
$_COOKIE = stripslashes_array($_COOKIE);
$_FILES = stripslashes_array($_FILES);
$_ENV = stripslashes_array($_ENV);
$_REQUEST = stripslashes_array($_REQUEST);
$HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS);
$HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS);
$HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS);
$HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES);
$HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS);
if (isset($_SESSION)) #These are unconfirmed (?)
{
$_SESSION = stripslashes_array($_SESSION, '');
$HTTP_SESSION_VARS = stripslashes_array($HTTP_SESSION_VARS, '');
}
/*
The $GLOBALS array is also slash-encoded, but when all the above are
changed, $GLOBALS is updated to reflect those changes. (Therefore
$GLOBALS should never be modified directly). $GLOBALS also contains
infinite recursion, so it's dangerous...
*/
}
}

function stripslashes_array($data)
{
if (is_array($data))
{
foreach ($data as $key => $value)
{
$data[$key] = stripslashes_array($value);
}
return $data;
}
else
{
return stripslashes($data);
}
}

clear_magic_quotes(); // disable magic quotes
?>

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

“ereg” & “eregi” has been deprecated in PHP 5.3 and PHP 6.x

0
Filed under Developement, PHP
Tagged as , , , ,

I was working on a new PHP script when I needed to remove some characters from a random string. Generall I would use ereg, or even eregi (if the string has both upper and lower case. But since the string had some non-alphabetical characters, I had to check on the syntac in the PHP manual to see how to remove them.

But then I noticed that both ereg & eregi has been DEPRECATED, or REMOVED from PHP 5.3 & PHP 6.x

Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.

Now I can’t finish the project until I find a good substitute…….

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis

Great MD4 / MD5 / SHA-1 hash script

0
Filed under Web Development
Tagged as , , , ,

I just found a cool website, that will create an MD4, MD5 & SHA-1 hash for you, from any given string.

This is ideal if you quickly need to created an encrypted password, or want to change a password on a system that uses MD5 or something similar.

The site is here

You can also download the software, and install it on your own server for quick reference.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • De.lirio.us
  • email
  • Furl
  • laaik.it
  • LinkedIn
  • MySpace
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb
  • Print
  • TwitThis