Category: Ynef’s DIY

Simple php guestbook script – Free download

I didn’t have anything better to do today so I decided to learn a little bit how to communicate with MYSQL databases using PHP. With this wonderful tutorial to help me I was able to construct a very basic guestbook script in about 4 hours. I know it shouldn’t take that long, but please keep in mind that this is my first ever attempt to create something like this with MYSQL and PHP.

Here’s a screenshot of the actual guestbook in action:

Ynef's random script screenshotAs you can see it’s very basic, nothing fancy.

You might notice that the title of my guestbook is Well, at first I wanted to create something similar to 4chan, but right now there is no option to post images- only text replies. I might add the option to browse and post images in the future when I learn more PHP.

What wasn’t mentioned in the above tutorial:

First of all if you follow the tutorial I mentioned above your script will work, but it will post an empty message every time someone visits or refreshes the page. To counter this I added if ($post != ”) right before the part where new posts are inserted into the MYSQL database.

This is a simple if statement that makes sure to only continue when the variable $post is not empty. Oh and don’t forget to put the code that inserts stuff into your database inside these brackets { }.


Another thing I added was the date of the post: $today = date(“F j, Y, g:i a”); Now you just have to echo the date variable $today along with your post.


I also tried making the guestbook a little bit more secure. By default if you follow the tutorial I mentioned your guestbook will be vulnerable to Cross Site Scripting attacks. In other words a bad person can submit malicious code along with his post and the next time someone visits the page that code will run. I looked into this briefly and I believe I was able to secure the guestbook by making sure that tags like <html> and <script> etc. are getting excluded when echoing the posts. It was really easy to implement with strip_tags();


Downloading and installing the free guestbook script

Download file:


Installing notes:


1. Open install.php in notepad and change the database variables to your own MYSQL database values

2. Upload install.php into your web directory and run it in your browser

3. Delete the install.php from your web directory

4. Open index.php in notepad and change the database variables to your own MYSQL database values

You can also change the title within the <title> tags and the guestbook name within the <h1> tags.

Yeah, I guess I could have just put the variables in one simple config file and included it in both install.php and index.php, but I was just too lazy.

5. Now upload both index.php and style.css to your web folder


If you followed the above steps then your guestbook should be working. If not please let me know!


[DIY] – How to cure stress and mild depression in just 30 days

Stress reduction exercise – how to deal with stress

NB! Once you start actively doing this, some people, especially your loved ones, can easily misinterpret this activity as obsessive compulsive disorder. Kindly refer them to this article to explain what it is that you are doing!


1 pencil

30 sheets of paper


Blue, yellow and red colored pencils

The method

The method is actually pretty straightforward. Starting from today, take one of your sheets of paper and draw a circle in the middle of the paper. When you have done that it’s time to fully color the inside of your circle. The trick is to try and draw a perfect circle by hand without using any special tools whatsoever. The more time you spend drawing and perfecting your circle, the better the end result! Use a new sheet of paper every day.

How to cure stress and stress reduction tricks

What is this nonsense?

A circle is an object that represents fullness and completion. When you are drawing a circle you are effectively reprogramming your brain into thinking about this which in turn makes you feel fulfilled and complete. In order to REALLY max out the effect, it’s important to fill the inside of your circle otherwise you might start feeling emptiness in a very short time.

It takes about 5-10 days to “kick in”. You will not notice the change at first and in the beginning it will most likely feel very tedious and stupid drawing circles every day. Don’t give up! It’s perfectly normal to feel this way because over the years we have built ourselves certain behavior patterns that society considers to be the norm and our brain is trying to weed out everything odd and peculiar. In reality when you really think about it, drawing circles every day doesn’t necessarily make you insane so there is no need to feel this way. Your brain just tries to tell you this in order to fit into the common social mechanism. It’s kind of like self preservation really.


It’s best to draw a circle with a diameter of at least 2 cm, the bigger the better. If your circle is too small your brain doesn’t have enough time to really get into the “mood” and it will dismiss it as something unimportant.

It’s better if you do this in the morning as you’re eating breakfast or drinking your coffee. This way your whole day will feel a little bit better. By the way, try to not drink more than one cup of coffee every day.

If you happen to have blue, red and yellow colors then you can even change the way your entire day will unfold! Simply paint the circle blue if you want to have a relaxing and calm day. Red if you need to be successful in something (job interview, exam etc.) or yellow if you need to stay friendly (going out with friends).

Don’t stop after 30 days! While one month should be enough for the average person, it can sometimes take a little bit longer. We are all different after all. And even if you are feeling like a whole new person after a month, you still don’t have to stop. When you continue doing this, you will make sure these effects are not fading away over time. You will start feeling so good that you can’t help but tell others about this too!

A good idea is to go jogging or simply take a walk outside for at least 15 minutes after you have drawn your circle for the day- this is what’s actually important in all this, lol 😛


Flipping items on the Grand Exchange – A short how to tutorial

Flipping items is not rocket science

Despite what a lot of players think, flipping items is actually pretty simple and straightforward. The idea is to generate a profit by buying items below the average market price and after a while selling these items above the average market price (the buy low, sell high principle that works with any business).

Best items for flipping in the Grand Exchange

Runescape character thinking about flipping items on the Grand ExchangeBefore getting started you should understand that you can’t flip everything. Certain items are simply losing their value all the time, thus making them literally a black hole for your gold coins.

Then there are items that simply won’t sell only at certain times. The Santa Hat, for example, doesn’t sell in the middle of July etc.

Finding profitable items for flipping in GE

The easiest way to find a profitable item is to look for items that are in great demand such as things that are directly linked to skilling. For example herbs, seeds, ores, etc. are all required and in great demand because players are always trying to level up their skills using these items.

After you have chosen your item, it’s time to take a look at the price graph to make sure your items overall price trend is upwards, not downwards. You don’t want to end up with stuff that are clearly losing their value. To do that we simply enter our item name + grand exchange into Google search, for example “iron bar grand exchange”.

Iron bar showing uptrend in the price graphNow that the graph is displayed we can clearly see that the Iron Bar has an overall upward trend. You have to look at the entire graph, not just the last (right side) tip of the graph to understand where the trend is going.

If you don’t understand graphs that well there are plenty of tutorials and guides available online about how to properly analyze graphs and how to spot trends in the price movement. It’s really interesting stuff so I recommend looking into it! 😉

Buying and Selling on the Grand Exchange

After analyzing the market we have finally chosen which item to flip – for this guide, it’s the Iron Bar used mainly in the Smithing skill to make weapons, armor, arrow tips and nails.

The first thing we do is called a test buy. We simply buy one of the Iron Bars and put in a higher price than the average market price to make sure our item buys instantly. This is how we know exactly what the current price of our item is.

Test buy iron bar in the grand exchange for later flipping

As you can see on the picture to the left we entered 567 gp as the price we wanted to buy, but the item actually bought for 566 gp giving us back the change of 1 gp.

We now know that 566 gp is the actual price that Iron Bars are going for in the Grand Exchange at this moment.

Remember the price graph? The trend is clearly upwards so we are pretty confident that we can sell the Iron Bar back to the market for a higher price than 566 gp.


Picking the right price for selling

After raising the iron bar price in the grand exchange for 5 percent

The trick is to put the item up for sale and increase its price by five percent. To do that simply click on the +5% button and Grand Exchange will automatically adjust your selling price.

But that’s not the price we want to sell because a lot of other people are probably doing the same.

We need to target the “Desperate buyer” who rushes to GE and makes a buy order immediately with +5% without worrying much about market prices. These type of players just want to receive the item as fast as possible so they can go skilling and advance their levels.

In order to sell to these players the price must be adjusted in a way that it’s still above the overall market price, but below the +5% price. When we adjust our selling price in this way, we make sure the desperate buyer will buy from us first. Makes sense?

Iron Bar sold for 577 gp in the grand exchange of Runescape

Instead of trying to sell for 595 gp (the +5%) we are lowering the price to 577 gp aiming for a quick 11 gp profit per Iron Bar.

As you can see just a few moments later someone had bought our Iron Bar for 577 gp! I am sure if we waited long enough, we could sell it for 595+ as well, because the general price for Iron Bar is currently climbing. For now let’s settle with just 11 gp profit per Iron Bar.

Now we just have to repeat this process and buy 5000 Iron Bars giving us a good 55,000 profit flipping the Iron Bar.

Valuable items = More profits!

The Iron Bar in our example isn’t a valuable item and because of this the profits are smaller too. If you want to make more money flipping items on the Grand Exchange you just have to buy and sell things that cost more. The price difference is bigger there and so are your profits.

NB! I advise you to invest only 10-20% of your entire capital into flipping. This way you can safely trade without losing your entire cash pile should the trend change and prices fall.


Why you shouldn’t underestimate the Farming skill in Runescape

Farming skill in Runescape

The skill “Farming” requires a pay-to-play account and it’s an amazing skill that lets you plant herbs, bushes, trees and flowers that can be harvested and most of the harvested items can then later be used in various other skills. For example the Herblore skill uses herbs that are grown with the Farming skill and these are used to make potions that boost your stats or give you other advantages in the game.


Don’t underestimate the Farming skill

You hear it a lot from other players that the skill is tedious and time consuming and really not worth the trouble. The experience seems to come slowly and you can only plant a tree once every day per patch, because it takes 12 hours or so to fully grow and be ready for harvest (that’s when the experience will come).

Placing supercompost on a herb patch

The small stuff like applying supercompost or planting a seed give very small amounts of experience indeed, but the main XP will come AFTER you have planted and grown a plant to its full size. It’s especially true with trees like the Magic Tree that gives a whooping 13,768+ XP after you check it for health (that’s without any experience boosts).

If you are just starting out, I advise you to complete the quest Fairy Tale I – Growing Pains. After finishing this quest your farming level is raised instantly from 1 to 17. For more farming experience simply keep growing the best that you can afford. Remember, trees give the most experience.


Serious farming and money making

After you get 85 farming things will really start to get profitable because you can now grow Torstol, the herb that is used to make Zamorak Brews- a wildly sought after potion that raises Attack and Strength levels temporarily.

You can get Torstol seed from the Grand Exchange for a measly 17,000+ coins. The yield is around 8-10 herbs per seed and they sell for over 5,000+ coins each, making your pure profit anywhere between 23,000 to 33,000 per seed!

Below are the results of my latest herb run:

4 seeds = 70,844 coins

37 herbs = 200,799 coins

Making the total profit from this run 129,955 coins.

Remember, you can do this 4 times per hour! (because seeds take around 15 minutes or so to grow).

That’s 519,820+ coins per hour!

This is just the result of an average herb run, I’ve picked 51 herbs too which add up to 848,824+ coins per hour!

Grand Exchange Bought 4 Torstol SeedsGrand Exchange Grimy Torstol Sold for 200k








As of October 2014 Farming is probably the most profitable skill right now.