George Pearce - iamPearce

Icon

Homepage of 18 year old internet nerd, George Pearce.

Facebook Apps

I’m looking at building a Facebook app, just to see if I an and because I think it’d take up some of the spare time I’ll have very shortly.

I’ve been reading the API tutorials that I’ve found lying around, and it doesn’t seem so difficult – my biggest issue is that I’m not sure what kind of app I should make – any suggestions?

I’ve been looking a little more into it recently, as I’ve been using Facebook more (add me – my link is on the right), and it looks like there is some good money in this app building thing too, if you can show your own ads and so on, which is also another bonus to me learning properly how to make my own.

It *looks* like I can write one in PHP, so I won’t even have to learn much new, I was thinking of something pretty basic for my first time around, and I’ll work up from that.

Drop a comment if you have an idea that I can ‘borrow’, or something I could make for you :)

Learning CodeIgniter

I’ve decided that I’m going to learn how to use the codeigniter framework, because it looks like something that I would benefit from knowing, and that would make any coding I do quite a bit easier.

I made my first bit of code!

Yep, I’ve written my first thing in php! :D

I’ve written a very basic advertising rotation script, which I’ll put online sometime soon, because I can.

Basically, it selects a random banner from a table defined in the script, and then puts the code into html format for it. It also counts the total number of impressions on that code, not clicks, but impressions, and I’ll make a (very basic) stats page for it soon.

Next up, a tinyurl redirection script for GPearce :D

PHP Cheat Sheet

I’ve put together this ‘cheat sheet’ in the hope that it helps some people, it shows the correct syntax for various statements and I shall add to it as I have time.

PHP Statements
array ( “key” => “value”, … );
die(”messagetoshow”);
echo item;
extract ($array;)
header (”Location: url“);
if (condition) {operation]
elseif (condition) {operation}
else {operation};
session_start();
session_destroy();

PHP MySQL Functions
mysql_connect(”host”,”uname”,”password”);
mysql_select_db(”dbname“);
mysql_query(”query“);
mysql_num_rows($result);
mysql_fetch_array($result,type_of_array);

I hope this helps someone, a lot of it was learned from the dummies book and W3schools :)

-G

Installing Apache, PHP and MySQL on Ubuntu

 

This tutorial is designed to help you install the LAMP (Linux,Apache,MySQL,PHP) combo on your Ubuntu machine.

What You Need

Ubuntu (Obviously)
Root Access Password
About 7gigs HDD space (ish)

Step 1
You firstly need to install Apache 2 onto your machine. Fire up the terminal, and enter:
sudo apt-get install apache2
It should then install automatically.
To start Apache, use the following command:
sudo /etc/init.d/apache2 start
And to stop it;
sudo /etc/init.d/apache2 stop

You should then be able to goto http://localhost , and see some default text, something like “It works!”

Step 2
Next up is PHP, enter the following code in terminal:
sudo apt-get install php5 libapache2-mod-php5
Then restart Apache;
sudo /etc/init.d/apache2 restart ;
and PHP is done. You can change PHP5 to any version you like , but PHP5 is recommended.

Step 3
Next, we install MySQL. It’s also very simple, run the following in terminal:
sudo apt-get install mysql-server
And then you need to set the root password for MySQL (important)
mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(’password!’);
And that’s MySQL In. Restart Apache again;
sudo /etc/init.d/apache2 restart ;
And it should all work nicely!

An excellent tool for PHP is PhpMyAdmin, which can be installed with the following:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

And that’s it! All done. If you have any problems with PhpMyAdmin, try rebooting apache.

Have fun with LAMP!

–George

Hello

I'm George Pearce - and this is my personal blog. I'm 18, and I also write about blogging, Linux, and soon, physics. I like to take photos sometimes, and I tweet a lot @pearce.