Archive for the ‘Tutorials’ Category
Daily Tutorial: Count The Number Of Chatters In IRC
In honor of IRCNode’s return, there will be several IRC related tutorials posted today. Daily tutorials start up again today, and I’ll keep going 30 days from now to apologize for my disappearance.
IRCNode’s website isn’t back up yet, but the IRC network itself is doing well. Just connect to irc.ircnode.org or use the Mibbit Web Client. Be sure to come hang out in #lobby.
The Tutorial
As with all my tutorials, I put the instructions inside the code as comments. The instructions are preceded by two back slashes (//) and are generally found below the line they are explaining.
If you have any problems with this tutorial, please post a comment or email me at naresh@eNaresh.com.
I’d only use this code on a CRON job and save the data to a MySQL database, because it takes a few seconds to run. If you don’t have CRON jobs, email me (naresh@eNaresh.com), and I can set it up on my server.
Requested: Ban System Admin Panel
This isn’t today’s tutorial. Today’s tutorial was on creating daily backups with PHP.
Cyrus Kafai Wu requested that I write an admin control panel for the ban system posted yesterday. Here you go, Cyrus.
Daily PHP Tutorial: Create Easy Daily Backups
We’re now 9 days in to the tutorial marathon. I’m having a good time with this, and I hope you are too!
This tutorial was requested in the comments a few days ago. It’s a PHP script that will allow you to easily create daily backups of your website. It does require that you are on a linux web server.
The “tar” command in linux allows you to create .tar archives of your directories. We’re going to use that command in conjunction with the “system” PHP Function.
The Code
As with all my tutorials, the instructions are included inside the code so even the copy and pasters can learn a thing or two. They’re inside the code as comments, or lines preceded with two backslashes.
Run this code with a CRON job for best results. I wouldn’t run it more than once a day unless your files change very frequently. Don’t have CRON Jobs? Send me the URL of this file on your server along with how frequently you want to backup, and I’ll configure my server to trigger backups at intervals of your choice. naresh@eNaresh.com
Remap Your Keyboard With SharpKeys
If you follow my Twitter, you might have seen a tweet yesterday evening saying I broke my “L” key completely. The rubber contact below the plastic key broke, and the key was rendered completely useless. I solved this problem by remapping my keyboard with SharpKeys, and my new “L” key is my former “Caps Lock”.
Remapping your keyboard allows you to reprogram a button. It can be done manually, but is a tedious process. It didn’t even work for me when I gave it a try.
SharpKeys from RandyRants.com solved the problem perfectly. You simply select which key to replace, and the new action for that key. Reboot or logout, and your keyboard is remapped!
Daily PHP Tutorial: PHP Ban System
We’re on day eight of the tutorial marathon, and I’m still going strong(ish). Today’s tutorial is yet another requested tutorial teaching you how to ban your problematic website visitors. This tutorial is for you, Marcos in Austin, TX.
You can view an example of this by going to: http://enaresh.com/tut_files/banned.
PHP Tutorial: Edit Your CSS From A Web Form
I mentioned earlier that my CSS was deleted by a PHP file I stupidly left out in the open. The file was the code for a requested tutorial that I didn’t publish until right now.
This tutorial teaches you how to create a file that will allow you to edit your CSS file easily from an admin control panel. Don’t leave this file out in the open like I did.
I know this is another simple tutorial. I’ll have part two of the forum tutorial up sometime tomorrow afternoon.
Please send any requests to naresh@eNaresh.com or post a comment.
PHP Tutorial: Take Your Music Library With You
As requested yesterday by email, today’s daily tutorial teaches you how to take your music library with you anywhere you have internet.
While there are other ways to do this using programs that plug in directly to iTunes, we’re just going to create a simple PHP script that will list every file in a directory, and enable them to play inside a flash mp3 player.
You can either setup PHP and Apache on your home computer or upload your MP3s to a web host.
Example: http://enaresh.com/tut_files/music/
Daily PHP Tutorial: Create A Forum (Part One)
We’re now 4 days into the tutorial marathon here on eNaresh. If you’re new, I’m writing a new PHP tutorial every day of November. The past tutorials are in the PHP Tutorials Archive.
I’m starting a new series of tutorials today. We’re going to start coding a forum with PHP and MySQL. This series will probably have upwards of 10 parts, and I’ll make sure it’s secure, powerful, and easy to use. This series will not be object oriented, but may be re-released OOP in the future.
You can view an example of part one here: http://enaresh.com/tut_files/forum/
PHP Tutorial: Create A Podcast Player
I’m 3 days into the November Tutorial Marathon. I’m posting one tutorial every day throughout November. Please send requests and suggestions to naresh@eNaresh.com
Today’s Tutorial: We’re going to load a podcast RSS feed, separate the items, and display them with a nice Flash mp3 player from Yahoo. Alternating row colors will come into play today as well.
Example: http://enaresh.com/tut_files/podcast/
Oh, and there might be a bonus at the end of this post. Who knows…
TOD: Using Explode & Create PHP Function Resource
Here’s today’s PHP tutorial of the day. If you haven’t heard yet, I’m writing one tutorial every day for a month. This is the second tutorial of the month. Remember, I need your suggestions, so please request tutorials by emailing naresh@eNaresh.com. I’ll even plug your website in the post.
Today’s tutorial covers the explode function. I wanted to use it in a somewhat practical application, so the code in this tutorial will show information about a given PHP function, taken from the PHP Manual.
As with all of my tutorials, the instructions are located inside the code as comments. This way, even the copy and pasters can learn a thing or two.
Example: http://enaresh.com/tut_files/manual/
The rest of the tutorial is in the full post.




