Conor Mac Aoidh
http://macaoidh.name
conor@macaoidh.name
 

Search

Archives

  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008

Spam

3,943 spam comments
blocked by
Akismet

Tag Cloud

    bt broadband CMS conor's management system conormacaoidh conor mac aoidh content management system drums fast Fedora fedora 10 furasta furasta cms furasta org gnome guide hello world HTML icsp iPhone jar Java javascript joomla kde Linux Mandriva mc kennas Monaghan Music mysql php Scratch stealing the ceiling The Dominican Affair the pot smoking pirates the strats tutorial Twitter updates web design forum webme webworks weekly tweets Windows wordpress

Ads

Website Re-Design

Posted Mar 26th, 2009 by Conor in in My Blog, Web Projects

As you may have noticed macaoidh.name has changed big time in the last few days.

* Reader Sighs, not another bloody theme change… *

You are right, this is not just another theme change but a complete website overhaul! Over the past few months, in fact ever since I made the blog, I have been changing theme pretty regularily. That is because I never found a damn theme that I actually liked! So the other day I was bored and said f**k it I’ll just make my own theme and then everything will be the way I want it right? Wrong. No actually your right I just wanted to grab your attention again!

Then acting on my bordness I thought about the idea for a few days and came up with and ingenious idea to loose all of my blog traffic – move the blog to a new subdomain! And that’s exactly what I did and that’s exactly where you are now. In my subdomain, your in my subdomain. Being a web developer and not a web designer I have to think about designs for a few days before something hits me. And a few days ago this design hit me. So I made it.

Just in case you have not yet noticed, macaoidh.name is now split up into three different websites! Overkill I say. Who said that? Anyway.. there is my web design/developement portfolio located at http://portfolio.macaoidh.name, my blog located here at http://blog.macaoidh.name and my home page located at http://macaoidh.name. My blog being a blog runs Wordpress, so that’s one Wordpress theme I had to come up with. Both my Homepage (I really don’t know what I was thinking about making that…) and my Portfolio run Furasta CMS, which to those of you that aren’t complete randomers and actually know me, is my CMS. I own it. It’s mine. Is liomsa é.

Bored yet? So am I.

So I now have a nice wee set up going on which I don’t plan to change in the foreseeable future. I might actually release my wp theme at some stage, I’ll see what people think of it first. At the moment I would like some comments on the design. Display problems? I think not. Unless you are using IE6 because that’s like the only browser it’s not tested in. One design problem that struck me; to sidebar or not to sidebar? I decided in the end as you can see to go for not to sidebar. All Wordpress blogs have sidebars, at least all that I have seen. So I decided not to conform and to but my RSS link up on the main menu.

That’s about it. If you are a new reader or an old reader who’s feed got messed up by the domain change, then don’t hesitate to subscribe to my feed! It’s the bright orange icon on my main menu.

No responses yet

Collecting Data From Forms – PHP / MySQL

Posted Mar 20th, 2009 by Conor in in HTML, Languages, PHP

Today i had quite a few requests for the same thing on the Web Design Forum. So instead of writing a different answer to all of the threads I decided to summarise it all in a blog post on Collecting Data From Forms Using PHP and MySQL. Hopefully I will just be able to link back to this post when I get this question again!

What is PHP? PHP is a programing language with an easy to use syntax. It resembles C and Java. PHP is excecuted server side which means that if you want to do something with the language then you will have to send a request to the server. This is usually done by pointing to a PHP file to proccess information. It can also be done using AJAX without requiring a reload – but that’s a whole other ball game!

What is MySQL? MySQL is one of many Structured Query Languages. It is basically a language used to store and manipulate data through the use of databases. I have often compared it to Microsoft’s Excel – many people tell me that I’m wrong with that comparison but I think that it is valid!

PHP + MySQL = Dynamic Webpage. In my opinion MySQL and PHP have one common characteristic; they both have a user friendly syntax which is easy to learn and yet they both have the ability to unleash massive amounts of power once you delve into them! The combination of the two languages produces a constantly changing, dynamic website. For example you could have page content being called from the database and then to update that content all you need to do is update the database – rather than trawling through code.

If you are finding this all hard to follow don’t worry, I’m sure it will be a bit more self-explanatory when we look at some code. I am not going to go into the detail of downloading and installing PHP and MySQL. The following assumes that you have done so yourself – or that you are working on an online server with these packages pre-installed.

Setting Up MySQL

First you will need to create a new database and a new table for all of the information to be stored in. Enter this command to create the database:

create database form;

Quickly select that database – tell MySQL that you want to use it.

use form;

Then you will need to create a table which will store our information.

create table users (
user_id int not null auto_increment primary key,
username text,
email text,
password char(40) default null
);

Now that you have the MySQL side of things running you will need to connect to MySQL with PHP. The file below should be named ‘connect.php’.  /*These things are comments */

<?php

/* The name of the database that we have just created */

$dbname = 'form';

/* The hostname which will usually be localhost but change if appropriate */

$hostname = 'localhost';

/* Database Username and Password - you must change these to your own values*/

$dbuser = 'root';

$dbpass = '';

$connect = mysql_connect($hostname,$dbuser,$dbpass) or die('Could not connect to MySQL please insure that the connection information is correct');

mysql_select_db($dbname,$connect) or die('Could not select the database');

?>

Writing The Form

Now that we have written our connection information with PHP we must include that file in our main PHP file and write a form. This is a normal HTML form which collects information from users wishing to register to whatever.

<form method="post">
Username: <input type="text" name="username"/><br/>
Email: <input type="text" name="email"/><br/>
Password: <input type="password" name="password"/><br/>
Confirm: <input type="password" name="confirmpass"/><br/>
<input type="submit" name="save" value="Register"/>
</form>

That is alright as it is but it doesn’t really do anything. If we want to collect that information then we must work our PHP magic! This file contains the same HTML form but it is written in PHP and is named ‘form.php’.

<?php

/* Include the connection file that we created earlier */

require_once 'connect.php';

/* If the user presses the submit save the information to the database and display a thank you message */

if(isset($_POST['save'])){

/* Get the values submitted from the form */

$username = addslashes($_POST['username']);

$email = addslashes($_POST['email']);

$pass = $_POST['password'];

$password = sha1(strip_tags($pass));

/* Check to see if the two password values are correct */

if($pass!=$_POST['confirmpass'] || $pass=='') die('Passwords do not match. <a href="form.php">Return to form.</a>');

/* Update the database with the new information or die with the mysql error */

mysql_query("insert into users values ('','$username','$email','$password')") or die(mysql_error());

/* Display thank you message and exit */

echo '

<h1>',$username,' Thank You For Registering!</h1>

';

exit;

}

/* Else display the form so the user can register */

echo '

<form method="post">

Username: <input type="text" name="username"/><br/>

Email: <input type="text" name="email"/><br/>

Password: <input type="password" name="password"/><br/>

Confirm: <input type="password" name="confirmpass"/><br/>

<input type="submit" name="save" value="Register"/>

</form>

';

/* Close MySQL, exit and close PHP */

mysql_close();

exit;

?>

Woah! Thank god that’s over. If all goes well you will not have any errors running that script. Anyway that’s all the advice I can give you for one day. Good luck!

Please feel free to use or adapt this code as you will. I understand that this isn’t a prime example but it sets the foundation of what you can customise in order to create a brilliant user freindly form! You could also try adding more verification to the form or even using some unobstructive JavaScript to make it look nice. These are all things that I might write a tutorial about in the future but that’s it for now!

No responses yet

Fedora and KDE

Posted Mar 18th, 2009 by Conor in in Fedora, Linux

I installed KDE on my Fedora 10 installation yesterday.

yum install @kde-desktop

God damn it’s refreshing! I got really bored of the dullness of Gnome and just decided to get rid of it! I had forgotten how great KDE 4.1 really is. It just looks so different and simply better!

I managed to completely screw up my computer in the process though! After I changed I decided to mess about with my graphics settings and try and get out of bloody Vesa. But unfortunately there are no Fedora drivers for my Silicon Integrated Systems [SiS] card and I will inevitably have to use Vesa mode… Ah well I’ll just have to put up with my you tube videos skipping ’till Fedora 11! Anyway I screwed up the graphics and had to boot to init 3 and do a display reconfig;

system-config-display --reconfig

Once I was up and running again I got to work doing what KDErs do best; customisation. I found this cool desktop app called KDE Twitter. It allows me to tweet from my desktop! Pretty cool. Oh and the pride and joy of my new desktop; kooldock! It really is cool. It’s basically the same thing as the Mac OSX dock except as with KDE, better and more customisable. Installation is simple:

yum install kooldock

You can also set it to start the program as soon as you start the computer. Although it is a joy watching those icons bounce up and down this saves you having to run it manually every time! Go to System > System Settings > Autostart and add kooldock to the programs list.

Fedora and KDE both go very well together and it was well worth the change from dull Gnome. Here’s a screenshot:

Fedora KDE

Fedora KDE

One response so far

Conor In Characters

Posted Mar 9th, 2009 by Conor in in Me

This is cool… The Internet is cool…

It was 100% text but didn’t display so well so here’s an image!

Conor In Characters

Conor In Characters

It’s all about characters today. Who can guess what this means:

01000011-01101111-01101110-01101111-01110010-00100000-
01001101-01100001-01100011-00100000-
01000001-01101111-01101001-01100100-01101000-

Oh and the ‘-’ are spaces

One response so far
Next Entries »



Conor's Blog is powered by Wordpress | Template design by Conor Mac Aoidh