Archive for October 2014

Database Scripts for PHP & MySQL

Sanitize User Input: <?php function sanitizeString($var) { $var = stripslashes($var); $var = htmlentities($var); $var = strip_tags($var); return $var; } function sanitizeMySQL($var) { $var = mysql_real_escape_string($var); $var = sanitizeString($var); return $var; } ?> Attempt simple queries using MySQLi <?php require ‘connect_mysqli.php’;…Continue Reading →

Homework 4

For this assignment you should have a dummy version of the the website. Not all the functionality of the site needs to be working yet (e.g. it doesn’t need full database integration or totally working PHP code). You should be…Continue Reading →

Source Code for Homework Due 10/26

The homework due 10/26 is to expand the automated sprite class to perform one of two functions: evade the player sprite or chase the player sprite. If you normally sit on the left side of the class you should write…Continue Reading →

Database Slides

Cookies+and+Sessions Introduction+To+Databases MySQL+Part+II

In Class Code from 10/9

<?php /*printf(“My name is %s. I’m %d years old, which is %X in hexadecimal”, ‘Simon’, 33, “white”); printf(“The result is: $%.2f”, 123.42 / 12); $currTime = time() + (7 * 24 * 60 * 60); echo “<br>” . $currTime; //1412893018…Continue Reading →