My name is Darcy Clarke, and I am a Toronto based Web Developer. I have been building websites and applications for more then 6 years. I currently work for a small Marketing Company based out of Downtown Toronto developing dynamic websites that appeal both visually and functionally.
Read More

Since I have found some great audio and screen capturing software, I am going to start to make video tutorials starting with the HTML Series, which will have it’s first additions this weekend, including :
1-Start To Finish HTML Website
2-Photoshop to HTML Website
3-Maximizing your CSS
Hopefully people will enjoy these two tutorials and get something out of the video more then just text on screen. I will provide the source code and related files for each tutorial at the bottom of each post in case I have not been able to display the code clearly enough through the video.
And I am still taking suggestions for tutorials / tips / tricks for any coding language or web design skill you are looking to improve or learn on.
Enjoy the weekend fun!
In this tutorial I am going to show you how to create and use your own PHP function. Of course making a proper login for a website takes a bit more then just a user authentication, but I’m just going to use my authenticate function I use in my company’s website to show you how functions work in PHP.
-
-
// We First Set up the function by naming it something. In this case its "authenticate". You’ll also notice the two variables in brackets. These variables get sent when we call the function to check the username and password against our database.
-
function authenticate($username,$password){
-
// We set up a SQL database query within a variable called "sql" to look for the username and password we sent to the function.
-
$sql="SELECT * FROM usersDatabase WHERE username=’$username’ and password=’$password’";
-
// Mysql_query() actually sends our SQL to the database and returns and result
-
-
// We use my_sql_num_rows() another "pre-defined" function in PHP, to count how many rows return from the database.
-
-
-
// This conditional statement checks to see if the count variable is equal to 1, meaning that indeed the username and password were correct.
-
if($count==1){
-
// Now that we know the username and password checked out we can grab some of the users information to be returned and possibly used for other scripts.
-
-
-
-
// Setting up global variables means that these variables can be used by any other function after this function has been called and the variables have been declared. We set up a few variables we want to use through out our scripts here like the users name, ip, email, and id.
-
global $my_id,
$my_username,
$my_email,
$my_ip;
-
$my_id = $id;
-
$my_username = $username;
-
$my_email = $email;
-
$my_password = $password;
-
$my_ip = $_SERVER[‘REMOTE_ADDR’];
-
// We return a boolean "True" so that we can use our function in a conditional statement to allow more security to our scripts.
-
return true;
-
} else {
-
// If the username and password that were sent to the function didnt send back a row from the database then the authentication fails and returns a boolean of "false"
-
return false;
-
}
-
}
-
We can call this function in our code somewhere else like so:
-
-
// We use a conditional statement because our function returns a boolean value one way or another
-
if(authenticate(myusername,mypassword)){
-
print "Welcome $my_username!";
-
} else {
-
print "You are not logged in!";
-
}
-
As you can see above we also used one of the global variables we set in our function called “my_username”.
Hopefully that gives you and idea of how a function / authentication would work. This is very basic and I will be posting a more advanced, complete, login with cookies and protection against SQL injection attacks soon.
About a week ago facebook launched their big new revamp of the facebook interface. Users had been able to access the new look and functionality before this under the “beta” subdomain.
A first hand look at the new interface and layout may make seasoned users cringe. And they should be.
Read the rest of this entry »
I just recently downloaded the new Wordpress Application for the iPhone. With the advanced capabilities to surf and create content for the web through the iPhone so far I am happy to see blogging make it’s way onto this oh so capable platform.
Read the rest of this entry »
You will see me use many different logical and comparison operators in my tutorials. Many of this thinking is used through out more then just PHP. If you have coded in Javascript, C#, or any other similar dynamic programming language you should have a good grasp of the basic operators. Operators are usually found in “IF” and “WHILE” statements.
Read the rest of this entry »
To Start off my long awaited return to PHP tutorials I thought I might go over the proper way to establish a connection with a MySQL Database (PostgreSQL and Access DB connections will come at a later date).
Read the rest of this entry »
Since I have been on the search for about 2 months for a new code highlighter.. I think I have settled on Code Prettify. A nifty Wordpress plugin by Dean Lee. If all goes well I’ll be posting, my original intent of this blog, php tutorials and resources for fellow Web Developers.
Read the rest of this entry »

So I caved. Rogers / Fido offered a special deal.. it was the best I could hope for after months of campaigning against the Cell phone giant. Unfortunately I don’t think we would have seen any better if I had of held out. I think now is the time to jump on the band wagon… $100.00 a month averaging bills is going to kill everyone with the service, but lets just say that I got myself a deal. Or so I think >_>.

The most anticipated disaster of my gaming life struck hard today. I had been waiting for my xbox 360 elite to conk out on me after just shy of a years worth of gaming and so it has finally come. Rumors had spread that more and more elites where hitting the dusty trail to the Microsofts repair shops but I had hoped I could prolong this experience until a later date.
After buying my 360 Elite last August I knew I was buying into a long term investment. Close to a thousand bucks later and I still thought that my Elite would hold up where its predecessors had failed. I was wrong.
Read the rest of this entry »

Unfortunately I thought I had stumbled upon a great code highlighting wordpress plugin the other week, and so I began with the first, of many, php tutorials. Unfortunately, to my dismay, I found that there were many issues with the plugin.
Read the rest of this entry »