lang="en-US"> function –, LLC

Tagged: function


PHP Tutorial: Easy SQL Injection Prevention

I’ve noticed on several client games I’ve worked on recently that instead of creating a global cleaning function to prevent SQL injections they’re wrapping mysql_real_escape_string() calls around everything. Sure, putting this function around any...


PHP Tutorial: Dynamically Create an Email Address in CPanel

This assumes you have cPanel and permission to run the /scripts/addpop command. You’ll need to write functions for validateUsername, validatePassword, and usernameExists or you can click on the links for each of those and...


PHP Tutorial: Mixing HEX Colors

<?php /**************** * Purpose: mix two colors together * Precondition: two colors in hex RGB format * Postcondition: a single color returned that’s the combo of the two ****************/ function mixcolors($color1, $color2) { $c1_p1...


PHP Tutorial: Get Filename From Domain Path

<?php /**** * Purpose: get the filename from the path * Precondition: path i.e. * Postcondition: returns the filename i.e. contacts.php ****/ function fileName($path) { return substr($path, strrpos($path, ‘/’)+1, strlen($path)); } ?> Programming...