Aug 8, 2011

Wordpress Custom Login Page | Wordpress Login Page

WordPress Custom Login Page




Wordpress login page is pretty good and simple, but after some time you will also find it boring. So modifying your wordpress login page is a good idea. This will also attract the users of the site and also helpful if you have multi admin users.

It looks difficult but actually its simple. You need to create two images with the following names

  • login-bkg-tile.gif 

  • login-bkg-bottom.gif


and copy and paste them in the following directory of your wordpress site wp-admin/images/ folder.
Previously if any one wanted to change the login page, it was simple with getting two hurdles in between.

  1. The Image

  2. And The Wordpress Upgrade


Wordpress Custom Login Page

How will you get the images?
This question can be answered by your current theme, your theme will be having many images which will be matching with your site, I ll recommend you to take the body background image and play with it little bit to make two images as show above, else start with Photoshop for totally made from scratch two new images.

And the next tweak the upgrade.
Generally people upgrade their wordpress as soon as new version is available, but I recommend you that don't change until and unless you find it necessary. Playing with core files unnecessarily will either damage your few plugins(majorly jquery) and make them functionless or can break your theme or both.


The Ultimate Solution

Why don't I offer you a free plugin for this, so you can start going with it without any headache.



download

Aug 7, 2011

How To Stop SQL Injections in PHP | Best Way To Stop MYSQL Injections

Now a days hacking has became a hobby for young generations, people start hacking and destroy the websites just for the sake of fun or business, amongst all of them SQL injections also known as DdoS is becoming very famous. But what is SQL injections? Suppose you have a website or a forum where a user can find something for him/her. That person searches the keyword by using Search option, this is where SQL injections start, a normal search is ok, say about a server can handle couple of searches at a time, but what if same website opened in 100 windows and at the same time 100 searches or more then that are made, then your server will go down and hackers can easily break the firewall and hack your website data from the server.

This is very common now a days, so to get rid of this the php code of search should be changed.

Default Search Code:

[php]
// connect to the mysql database

$unsafe_var = $_POST["keyword"];

mysql_query("SELECT * FROM table1 where keyword='". <code>$unsafe_var</code> ."'");

// disconnect from the mysql database
[/php]

The best way is to use prepared statements
Something Like this

[php]
$preparedStatement = $db->prepare('SELECT * FROM employees WHERE name = :name');

$preparedStatement->execute(array(':name' => $name));

$rows = $preparedStatement->fetchAll();

[/php]

This is the best way to get rid of SQL Injections.
In the above SQL statements you pass to prepare is parsed and compiled by the database server. By specifying parameters (:name) we are telling the database engine where the filter should be on. Then when we call execute the prepared statement is combined with the parameter values we specify.

Simple and secure

So always use safe coding, after all coding is fun not destruction.

Happy Coding :)

Aug 6, 2011

How To Create A Fog Effect In Photoshop | Photoshop Fog Effect

The Fog Effect

Learn how to use Photoshop to add a cool fog effect to any photo. This tutorial will teach you just how to use several layers to create a realistic fog effect that appears thicker in the distance.

[caption id="attachment_480" align="alignnone" width="450" caption="Original Picture"][/caption]

[caption id="attachment_481" align="alignnone" width="450" caption="After"][/caption]

FIRST STEP:

Open a photo that you would like to add a fog effect to into Photoshop.



SECOND STEP:

In the Layers pallet, click on the New Adjustment Layer icon and select Solid Color. A window should appear where you can select a color. Select white as the color as click OK.





THIRD STEP:

A new layer called Color Fill 1</em> should appear. Reduce the opacity of this layer to 50%.



FOURTH STEP:

Select the Gradient tool from the toolbar. If you cannot find it, look for the Paint Bucket tool, click and hold on it, and a menu should appear where you can select the Gradient tool. Once you have the Gradient tool selected, the option bar should change to allow you to set the settings of the tool. Apply these settings:

Gradient: White to Black
Gradient Type: Linear
Mode: Normal
Opacity: 100%



FIFTH STEP:

Before we add a gradient, make sure that you have the layer mask selected. To do this, simply click on the thumbnail of the layer mask in the Layers pallet. Once the layer mask is selected, click on the horizon of your photo, press and hold the shift key, and drag a straight line to the bottom. By holding the shift key, the line that you draw will remain straight. The shift key also works for other Photoshop tools such as the Move Tool or Transform tool.



SIXTH STEP:

Press Ctrl+J or open the Layer menu and select Duplicate Layer to create a duplicate of the layer.



SEVENTH STEP:

Select the Eraser tool from the toolbar. The 'Eraser' settings should appear on the option bar where you can adjust the settings of the tool. Use a large brush size with a soft edge such as the one set in the image below.



EIGHT STEP:

First, make sure that you have the layer mask of the top layer selected. Erase the foreground area so that the fog appears stronger in the distance.





NINTH STEP:

Create a duplicate of the top layer by pressing Ctrl+J or opening the Layer menu and selecting Duplicate Layer. Change the opacity of this layer to 75%.



TENTH STEP:

Again, make sure that you have the layer mask of the top layer selected. Erase the foreground and background area so that the distance looks thick with fog.





ELEVENTH STEP:

In the Layers Pallet, click on the New Adjustment Layer icon and select Levels.



TWELFTH STEP:

The Levels tool should appear. This tool will let us adjust the thickness of the fog. To do this, drag the middle input slider towards the right to decrease the fog or towards the left to increase the fog. Click OK when you're done.





AND THAT'S A WRAP !! If You Like, You Can Also Use The Following Steps For Other Pictures Tooo ...