In this JavaScript video tutorial I spend some time explaining the complexity of using Arrays and Functions in JavaScript. If you missed part 1, watch that first JavaScript Video Tutorial.
JavaScript Arrays are different from many languages because you can pretty much throw anything in them. This is because JavaScript isn’t strongly typed once again.
JavaScript Functions are also odd because they don’t follow the normal scoping rules used in most other languages. And, did you know you can completely disregard the number of arguments a function will accept? You’ll learn this plus how to:
In this JavaScript Video Tutorial I will completely cover JavaScript Object Oriented Programming. If you haven’t watch part 1 of this tutorial first JavaScript Video Tutorial.
OOP in JavaScript works differently from other languages. Because JavaScript is loosely typed (datatypes don’t have to be explicitly stated) you are unable to implement certain OOP concepts in JavaScript. You can however take advantage of many of the positives obtained through the use of OOP using JavaScript.
In this video tutorial I cover numerous techniques that can be implemented by monitoring events. If you missed part 1 watch it first JavaScript Video Tutorial.
This video is both a review of what you were taught in part 1, but also you’ll learn:
Every Single Event in JavaScript
How to Create Inline JavaScript
How to Change CSS Styling on Anything Dynamically
Change Elements or Delete them Completely
Monitor Every Mouse Movement and Key Press Dynamically
And, numerous other things. All of the code follows the video. If you have any questions or comments, leave them below.
In this JavaScript Video Tutorial I’ll teach you all of the core knowledge needed to write JavaScript code in 30 minutes. I’ve never seen a tutorial like this and was interested in whether you all would like to see more tutorials like this?
I specifically cover the following topics:
JavaScript Datatypes
Embedding JavaScript
Linking to JavaScript
Conditional Statements
Looping
Arrays
Strings
Functions
And, a great deal more along the way. If you’d like to read this information in a slower for see JavaScript Scripting. I also created another JavaScript tutorial that also proceeds at a slower pace if you’d like to check that out Learn JavaScript.
All of the code used follows the video. Leave any questions or comments below 🙂
In this CSS Video Tutorial I’ll show you how to layout a whole web page using Cascading Style Sheets. I’ll create headers, content areas, footers and numerous sidebars. I’ll also show you how to make major changes to a website layout with a limited amount of coding.
All of the code used can be found in the article above and also follows the video tutorial. If you have any questions or comments leave them below. You can use the code in any way that you wish.
In this tutorial I’ll cover most every Cascading Style Sheet property not covered in CSS Tutorial Pt 1 and CSS Text Properties. Specifically I’ll show you how to style:
Backgrounds
Tables
Lists
Cursors
I’ll also introduce you to the box element and its numerous properties. If you’d prefer to read this information please see Learn CSS.
In this video tutorial I will begin going over every way you can style your web pages using Cascading Style Sheets (CSS). I specifically cover in this CSS Video Tutorial how to:
Link to External Style Sheets
Embed Style Sheet Definitions in HTML
What they Mean by Cascading
How CSS’s Work Differently with Inline versus Block Elements
I show you how to create a PHP / MySQL message board in this video tutorial. I start by showing you how to properly set up the database. this can be looked at as a review on how to write SQL as well.
In todays Programming tutorial I show you how to grab information from a website using Regular Expressions in PHP. The information was particularly hard to get for the following reasons:
It was plain text
There were no tags to search for
Data I wanted was laid out in an unorganized way
I had to search for odd unicode characters like ½
I did it though using Regular Expressions and I’ll show you how.
In this web design and programming video tutorial I’ll show you how to make a secure forgotten password script. These scripts are attacked more than mosts and normally are full of security flaws.
I specifically cover how to:
Strip dangerous code from user input using Regular Expressions
Enforce secure security questions
Avoid brute force attacks with CAPTCHA systems
Create secure encrypted temporary passwords
Mail new passwords
All of the code used will follow the video. If you have any questions or comments leave them below.
If you have a recommendation for a future tutorial leave that below as well 🙂
Code From the Video
<?php
session_start();
require_once(“./includes/confighamdb.php”);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
$query = “SELECT secques, email, userid FROM users WHERE userid=’$u'”;
$result = mysql_query ($query) or trigger_error(“Security Answer was Wrong”);
if (mysql_affected_rows() == 1) {
$row = mysql_fetch_array ($result, MYSQL_NUM);
mysql_free_result($result);
if($sq == $row[0])
{
$email = $row[1];
$p = substr ( md5(uniqid(rand(),1)), 3, 10);
$query2 = “UPDATE users SET pass=SHA(‘$p’) WHERE userid=’$u'”;
$result2 = mysql_query ($query2) or trigger_error(“Your Password Couldn’t be changed. Try later.”);
if (mysql_affected_rows() == 1) { // If it ran OK.
$body = “Your password has been temporarily changed to ‘$p’. Please log in using this password and your username. At that time you may change your password to something more familiar.”;
mail ($email, ‘Your temporary password.’, $body, ‘From: admin@sitename.com’);
echo ‘<h3>Your password has been changed. You will receive the new, temporary password at the email address with which you registered. Once you have logged in with this password, you may change it by clicking on the “Change Password” link.</h3>’;
mysql_close();
exit();
}
else {
echo “Security Answer was Wrong”;
mysql_close();
exit();
}
} else { // If it did not run OK.
echo ‘<p><font color=”red” size=”+1″>Your password could not be changed due to a system error. We apologize for any inconvenience.</font></p>’;
In this video tutorial I create an extremely secure PHP Login Script. If you didn’t watch part 20 of this tutorial, you should check it out to find out how to use PHP Sessions and Cookies.
To make this login secure I added all of the following security features:
Keep all user information stored on the server with Sessions
Run all input through very strict Regular Expressions
Regenerate a new session token every time the user updates sensitive information
I add a few additional tricks along the way. All of the code follows the video. If you have any ideas on how I could improve this script pass them along.
Code From the Video
Goodlogin.php Script
<?php
// Initialize a session.
session_start();
require_once(“./includes/confighamdb.php”);
?>
<?php
if (isset($_POST[‘submitted’])) { // Check if the form has been submitted.
if (preg_match (‘%^[A-Za-z0-9]\S{8,20}$%’, stripslashes(trim($_POST[‘userid’])))) {
$u = escape_data($_POST[‘userid’]);
} else {
$u = FALSE;
echo ‘<p><font color=”red” size=”+1″>Please enter a valid User ID!</font></p>’;
}
// FIX IT Check for a good password
if (preg_match (‘%^[A-Za-z0-9]\S{8,20}$%’, stripslashes(trim($_POST[‘pass’])))) {
$p = escape_data($_POST[‘pass’]);
} else {
$p = FALSE;
echo ‘<p><font color=”red” size=”+1″>Please enter a valid Password!</font></p>’;
}
// FIX IT PHP Code for the CAPTCHA System
$captchchk = 1;
require_once(‘./includes/recaptchalib.php’);
$privatekey = “privatekey”;
$resp = recaptcha_check_answer ($privatekey,
$_SERVER[“REMOTE_ADDR”],
$_POST[“recaptcha_challenge_field”],
$_POST[“recaptcha_response_field”]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
In part 6 of my PHP Security video tutorial I cover a ton of ways hackers attack and how to hold them off. If you missed previous tutorials please watch them first. Here is the first one PHP Security.
In this specific tutorial I will cover:
How Spammers take over Comment Boxes
The Dangers of Providing Access to your Insert, Delete and Update SQL Querys
How Hackers use include and require to attack your site
The Damage that can be Done by Directory Traversal
A few months ago a friend asked me to take a look at their website because they had been receiving an immense amount of spam. Worse yet they were also receiving threats from others to stop sending spam to them. I immediately knew they were being targeted by code injection, but as I dug around I found more danger than I was expecting.
It seems that their grandchild (No doubt a future Mark Zuckerberg) had created the shopping cart for them. The shopping cart application had little to know security. In seconds I was able to dump all of their customers credit card information on to the screen before their frightened eyes.
In this part of the Web Design and Programming Tutorial I will review how to use 3 global storage arrays available in PHP. Specifically in this video I’ll show you how to use:
Cookies: A storage array that you save on the clients computer. You access it by referring to $_COOKIE
Sessions: A storage array that you save on the server. It is accessed by referring to $_SESSION
Server Global: An array that contains info on your server and the client machine. You access it by referring to $_SERVER
In part 3 of my PHP Security video tutorial I go over the most vulnerable ways hackers attack websites. I focus a lot on authentication and client side attacks. Specifically I go over the tools and techniques used to:
Crack user ids and passwords
Catch and manipulate data sent from the browser to the server
Cheat encryption techniques
Down load and change how websites secure themselves
Cheat forgotten password scripts into giving up passwords