lang="en-US"> Code Snippets –  Design1online.com, LLC

Tagged: Code Snippets

0

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...

0

ML Text Based Game: Fantasy Quest

Haha I just found this old game I wrote in ML for a programming languages class in college. It takes about 20 minutes to play. Maybe it’ll be useful to someone out there? Code...

0

Cheat Sheet: ASP & PHP Cross Reference

I found this cool site that has examples cross-referencing PHP and ASP so you can see the difference (or use it if you’re switching from one language to the other). They also have a...

0

PHP Functions: Wiggle, Wobble, Squibble & Swipswap

Here are a few fun functions for word games, word scrambling and just plain word craziness. <?php /*********** * Purpose: move a certain letter to a certain position * Precondition: word, letter to move,...

1

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...

2

1 Code Snippet a Month Challenge

This was initially designed as a way for me to challenge myself in creating a code snippet every month that would be useful to online game development. I did pretty well at first but...

0

Useful AJAX Functions

/************** * Purpose: initalize ajax * Precondition: none * Postcondition: ajax xmlhttp object running **************/ //global variables var xmlhttp = false; //initalize ajax var queryString; //check if we’re using IE try {   xmlhttp...