Posts tagged internet

Microsoft Vs Google

You may have heard in the news recently, about Microsoft joining forces with Yahoo to try and take on Google. Well in this article I hope to explain to you what it is all about and how it effects you.

I could start off way back, right at the beginning of the two companies, but I’m not going to, as there would be too much to put into one article. However I will tell you a bit of background to the current situation, and what this means for: Google; Microsoft; Yahoo; and you, the computer user. Read the rest of this entry »

PHP – Fun with Functions

Hopefully you are pretty secure with the basics of PHP by now. If not, you should read part 1 and part 2 of this series. This part is about functions. What are they; how do you use them; and how can you utilise your own functions? Functions can be a great tool to speed up your coding and to make applications run much more smoothly, so let’s go!

What are functions?

Functions are blocks of code that can be called upon at any point in the script to perform a particular task or ‘function’. There are more than 750 functions built into a normal install of PHP, but you can define your own too, making them very versatile and easy. Read the rest of this entry »

PHP – Your Next Steps

Assuming you have read my basic introduction to PHP, you should have a fair understanding of what PHP is, how to write it, and how to assign and manipulate strings and numbers. In this tutorial, I will be teaching you about Arrays, Loops, and ‘if… else…’ statements. So, let’s get started.

Arrays

Say you had a big long list of related variables that you needed to store. For example, names of people. You could store them in separate strings, as you learned before, like this:

<?php
$name1 = "Matt";
$name2 = "Harry";
$name3 = "Bill";
$name4 = "John";
?>

However, doing this makes it difficult for them to interact with each other and makes looping through them all tricky. These problems can be solved by using an array. An array uses ‘keys’ to link the strings together in one variable. There are three types of array: numeric, associative, and multidimensional. I’ll leave out multidimensional arrays for now, and focus on numeric and associative as these are more common and easier to use. I will use a numeric array in this example, as there is only one factor linking the variables, the fact that they are all names. Read the rest of this entry »

PHP – The Basics

PHP Logo

PHP Logo

PHP has grown from nothing to become one of the most popular languages on the web. This is mainly because of it’s simple syntax, easy usage, and seamless integration with MySQL and other databases. It’s also free, which makes it a great tool for developers when designing interactive and

dynamic content. In fact, my blog is powered by the open-source software WordPress.org, which is written in PHP.

What is this ‘PHP’ thing?

You may be thinking “wow, it sounds great, but what is it?”. So here are a few points about PHP:

  • PHP stands for PHP: Hypertext Preprocessor (It’s a bit of a paradoxical name if you ask me!)
  • PHP is a server-side scripting language, which means the scripts are executed on the server – before the user sees any output. (This is similar to ASP.net)
  • The opposite of server-side is client-side. JavaScript is a client-side scripting language.
  • Although PHP is free and open source, you need a server to run PHP, you can’t just access it in your browser. Common servers include Apache and Microsoft’s IIS.
  • PHP files have the extension .php / .php3 / .phtml

What do I need?

To be honest, you don’t really need much at all! A simple text editor such as NotePad or TextEdit will suffice. I use NotePad++ for various reasons, outlined in my review, but mainly because of it’s syntax highlighting. You could also try NotePad2 for a more lightweight option.

Also, as I mentioned earlier, you need a webserver to parse the script. This means you will need to host your files somewhere. This could be locally, using a package such as XAMPP, or you could buy hosting, but make sure they offer PHP support. (Most hosts will, as PHP is free and open source.)

Got all that? Good, let’s start writing some code! Read the rest of this entry »

Using OO-PHP To Connect To A Database

With OO-PHP, you can dramatically speed up the coding process, and re-use code much more effectively. OO-PHP stands for Object Oriented PHP. This means it uses objects, which are collections of properties and methods, rather that a bunch of variables and functions.

Also, as the object is stored in an external file, it can be accessed from any of your pages and used anywhere on your site. This makes objects especially useful. A good example of this is using an object to connect to and interact with a database. In this example, I will use MySQL; but the beauty of objects is that you can change that one file and all the pages will be updated, which makes changing between databases easy! Read the rest of this entry »

Browsers – Comparison

Which is the best? Firstly, let’s get this out of the way. I use Mozilla Firefox. I like it because it is fast, accurate, has support for add-ons, and is totally free! I love my add-ons, in fact, I couldn’t really browse without them. But accuracy is the main factor for me. If a browser can’t render a page or interpret the code properly, then it’s not really a broswer at all, is it?

This is one of the main reasons why I loathe Internet Explorer. Yes… it’s Microsoft, yes… you have to have it. But it really gets on my nerves, especially as a web designer. 90% of my bugs are IE specific, even on fully W3C compliant pages! It’s actually quite a nice looking browser, the layout is simple and the options are clear, but it is let down by its inconsistencies and bugs, and its lack of add-ons. Read the rest of this entry »

Notepad++ Review

A handy text editor for all your programming and web developing needs. I have been using Notepad++ for a few months now, and I have really enjoyed using it. The layout is simple and easy to use, the colours are plain and not hard on the eyes, and it has syntax highlighting for hundreds of different languges including PHP, HTML, C++, Javascript, Java and ASP.

Probably the most useful feature of  Notepad++ is the tabbed editing window. This makes it really easy to switch between files and it makes error checking much more simple. Not to mention the taskbar space saved on Windows. In addition to this, there is a find & replace option which can be used to replace a certain phrase in ALL of the currently open documents. This saves loads of time and typing. Read the rest of this entry »