Welcome to slayer’s blog | Web Design tips & tutorials
HomeAbout Me
Scripts, Tutorials

Archive for the ‘Tutorials’ Category

This entry was guestblogged by lorz.

Have you ever wanted to snatch the source code of a webpage in order to get some information like the title, meta-tags or even some parts of the body? For example, suppose you know a website with weather forecast. Now you would like to have some weather forecast on your website too, but you do not want to update it manually.

In this post, we are going to build a simple function to get the source code of a specific url.

We start by defining our function with a single argument: $url;

function source_code ($url) {

Now we check to see if the function named curl_init exists.

if (function_exists (’curl_init’)) {

If the condition returns true, we grab the source code with the help of curl. First we have to initiate in a variable called $curl. Simple!

$curl = @curl_init ($url);

Now we define some options for $curl. CURLOPT_HEADER is used for including the header of the page. We do not need it. So we are going to set it to FALSE.

After this, we have CURLOPT_RETURNTRANSFER which we will set to TRUE because we want our source code returned as a simple string.

After this, we have CURLOPT_FOLLOWLOCATION, and we will set it to TRUE so that the script will follow any header(”Location:”) redirects.

And the last option is CURLOPT_USERAGENT, and this will be our $_SERVER['HTTP_USER_AGENT']), the User’s browser actually.

@curl_setopt ($curl, CURLOPT_HEADER, FALSE);
@curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE);
@curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, TRUE);
@curl_setopt ($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);

We finally get the source in $source, close curl, and return the results.

$source = @curl_exec ($curl);
@curl_close ($curl);
return $source;

Now we define our else condition, which will be used if curl_init does not exist. We simply use file_get_contents() to get the source code.

} else {
return @file_get_contents ($url);

To finish, we close both braces.

}
}

And that’s it! Now you have a fully working source code grabber script!

No, you don’t need an asterisk revealer to show the password. You can grab all the passwords just by using firefox. You don’t have to be a mastermind to do this, because by default its accessible by anyone.

Just try it: head over to Tools -> Options -> Security -> Show Passwords

I always choose to save my passwords on websites because of 2 reasons:

1 - Because i’m lazy to type it over and over again

Yes it’s true…it can be pretty annoying to type a password over and over again, especially if you use a website pretty often.

2- To avoid keylogging and password theft

Although i use Kaspersky Internet security and Keylogger hunter i don’t like taking chances(new exploits pop up every day) to enter my password over and over again on payment related web sites like visa/paypal/moneybookers/etc.

There are several ways you can block access to the stored passwords. I’ll show you an easy way to do it:

Set a master password method

Head over to Tools -> Options -> Security -> Tick Use a master password

This way when someone goes to Tools -> Options -> Security -> Show Passwords and tries to be a smartass then he will be prompted to enter the master password.

See! It wasn’t hard at all! And it really protects your passwords from enemies at your office.

Today a friend asked my help to disinfect his computer. After telling him on messenger how to do it, he said to me with a smiling face: “what did you just say? can you translate it to common language?”. Then i told him to go and setup remote assistance. He didn’t even know that remote assistance exists, so i had to explain to him step-by-step how to setup remote assistance. This is the 4th friend to who i explain this.

Because of this i decided to create this simple tutorial. I’m sure that on the web there are thousands of people who have no idea what remote assistance is.(and it will save me a lot of time when someone in my messenger list asks for my help)

Step 1: Head over to Start Menu -> Programs -> Remote assistance

Step 2: Select the option Invite someone to help you

Step 3: In the bottom of the screen select  Save invitation as a file (Advanced)

Step 4: Enter your name and the expiry time. The shorter the period the safer it is, because your computer may be hijacked during this process.

Step 5: Make sure you set a password! This is VERY important! Also make sure the password isn’t your windows  login password, nor a password like 1234. You will only communicate it to the person who is helping you.

Step 6: Save the file and send it to your friend. Make sure you save it to a commonly used location. The default name of the file is RAInvitation

That’s it. Your friend will now be able to connect to your PC. By default he will only be able to view your desktop. You have to grant him access so he can take full control.

Remote Assistance is a pretty noob program. For advanced users and for more complicated tasks(file sharing/advanced remote PC management) i highly suggest rAdmin

This tutorial is part of the Install scripts that are present in fantastico tutorials category

phpBB is a popular Internet forum package written in the PHP programming language. The name “phpBB” is an abbreviation of PHP Bulletin Board. Available under the GNU General Public License, phpBB is free software. 48 translations are available for phpBB2 as of 2007.

Main Website: http://phpbb.com/

Demo Website: http://styles.phpbb2.de/

Support forums: http://www.phpbb.com/community/

Step1: Open up phpbb’s main website and download phpbb2 latest release.

Step 2: Extract the contents of the archive and upload the content of the phpbb2 folder to your webserver using a FTP client like SmartFTP.

Step 3: Go to phpMyAdmin and create an empty database named phpbb.

Step 4: Chmod config.php to 777 using your ftp client.

Point your browser to http://yourwebsite.com/phpbb/install/install.php where you will have to fill in the mysql connection details.

Make sure you select MySQL 4x/5x because all webhosts have it installed, and mysql 3.x is old and at the installation method select Install.

After the installation is complete chmod config.php back to 644 and delete the install and contrib folders!

Thats it! phpbb2 was successfully installed on your server. Now you can login and head over to your admin panel where you can manage your forum. because phpbb is a very popular forum software you will find plenty of skins and mods to customize it ;)

The tutorial was made by a good friend of mine: xNight, and he gave me permission to post it here. You will find more of his designs on his portfolio page

In this tut i am going to show you how i made this signature:

Step 1: First i am going to open up a document of 308×140. Take the render you are going to use, don’t resize set, fill up your background with the render. In mine so far it took only 2 copies to fill up the background.

Step 2: Okay, now resize your render on your sig and duplicate it 3 times, giving you a total of 4. Hide all renders but the first one.
On the first render go to Filter -> Distort -> Wave where leave defaults and hit randomize a few times until you get something you like. Move the distorted layer to the left side of the sig.
Unhide the next layer and do the same thing, but this time move it to the right side. Set both distorted layers to screen.
Here’s mine so far:

Step 3: Hide your 3rd render and take out a soft smudge brush 60px, 50% strenght and smudge the render outwards, and set to color dodge. You should get something similar to this:

Step 4: Unhide your last render layer and feather/blend it a bit. Move it to where you think it looks the best.

Step 5: Duplicate the render layer one more time and go to Filter -> Distort -> Wave. Do that again. Now i moved that layer on top of my visible layer and then put it towards bottom of the sig to help the render blend in a bit. Set to screen.

Step 6: I made a new blank layer and got out a black rock brush(how to get rock brush explained in bottom), brushed around in a few spots to give it a little different look.
Sharpen the layer once: Filter -> Sharpen -> Sharpen and then set to overlay.

Step 7: Now make an other new layer and fill it with black: Shift + F5. Go to Filter -> Renders -> Lens Flare where use these settings: 100% 105mm prime, and make the light come from top. Remember to set to screen.

Step 8: Okay,its time for a few adjustment layers. look over to your layers palette(usually the bottom right tool bar in photoshop.
Do you see the little black/white circle? Click it and choose gradient map.
A box should pop up:

Click ok and set it to multiply and 30% opacity. Now go back to the little black/white circle, but this time go to curves and use these settings:

Go to the little black/white circle one more time, and this time use brightness/contrast with Brightness -10 and contrast +17.

This is what you should get:

Step 9: Make a new layer and go to Image -> Apply and hit OK. Next on that layer go to Filter -> Blur -> Gaussian blur and set it to 2px.

After this go to Edit -> Fade -> Gaussian blur. In the box that pops up change the blending mode to multiply and set opacity to 40%.

And here’s the finished Signature:

Now all you need to do is put your text on it with a tagline(i would recommend using a futuristic font)

This tutorial is part of the Install scripts that are present in fantastico tutorials category

WordPress is a blog publishing system written in PHP and backed by a MySQL database. WordPress is the official successor of b2\cafelog, developed by Michel Valdrighi. The name WordPress was suggested by Christine Selleck, a friend of lead developer Matt Mullenweg. WordPress first appeared in 2003 as a joint effort between Matt Mullenweg and Mike Little to create a fork of b2.

Main website: http://wordpress.org/

Demo website: http://demo.opensourcecms.com/wordpress/

Support forums: http://wordpress.org/support/

Manually installing wordpress is the easiest of all the CMS’s that exist. Really.

Step1: Head over to Wordpress Download Page and download the latest version of the blogging software.

Step 2: Extract the contents of the archive and upload the content of the wordpress folder to your webserver using a FTP client like SmartFTP.

Step 3: Open phpMyAdmin and create a database with the name wordpress.

Step 4: Rename wp-config-sample.php to wp-config.php after which open it up with a text editor and fill in the database connection details:

define(’DB_NAME’, ‘wordpress‘); // The name of the database
define(’DB_USER’, ‘usernamehere‘); // Your MySQL username
define(’DB_PASSWORD’, ‘yourpasswordhere‘); // …and password
define(’DB_HOST’, ‘localhost‘); // 99% chance you won’t need to change this value

Step 5: Point your browser to yourwebsite.com/wordpress/wp-admin/install.php enter your blog’s title and your email(for notifications) and press Install Wordpress button.

That’s it, you now can login with the username admin and the generated password.

Success!

WordPress has been installed. Now you can log in with the username “admin” and password “dc5aa2a”.

What did i tell you? It was simple wasn’t it? you now have a running blog and the next step is to customize it. Wordpress features lots and lots of plugins and cool themes so that you can personalize your blog as you wish.

This tutorial is part of the Install scripts that are present in fantastico tutorials category

Nucleus CMS is an open-source blog management software package written in PHP, with a MySQL backend, primarily written and maintained by Wouter Demuynck. It is used to manage frequently-updated Web content. With a little tweaking (mainly to skins) it might be considered a light content management system, although there is no facility to upload file types other than graphic files to be displayed within the blog pages.

Main website: http://nucleuscms.org

Demo website: http://demo.nucleuscms.org

Support forums: http://forum.nucleuscms.org

Step 1: Go to Nucleus Download Center and download the newest version of Nucleus Core.

Step 2: Extract the contents of the archive and upload the content of the nucleus332 folder to your webserver using a FTP client like SmartFTP.

Step 3: Using your FTP client CHMOD:

- config.php to 666

- /media/ directory to 777

Step 4: Open phpMyAdmin and create a database with the name nucleus.

Step 5: After uploading the files/chmoding them/creating the database point your browser to http://yourwebsite.com/nucleus/install.php

Here’s how to fill the fields:

Hostname: usually localhost

Username: database username

Password: database password

Database: nucleus, or the name of the database you created

Below you will find Directories and URLs, in 99% of the time nucleus will find the paths, if it doesn’t display them contact your hosting provider.

Administrator User setup

Here’s how to fill the fields:

Display name: the name that will be displayed at posts(after posted by:)

Real Name: your name, or nickname

Password: the password for your admin account

E-mail address: your valid email address(for notifications)

In the next step fill in your Blog’s name and short name.

If everything is filled out correctly hit Install Nucleus Button.

Nucleus will now populate the database

Step 6: After installing Nucleus chmod config.php back to 444 and delete install.php and install.sql.

If you got this far without errors it means that nucleus was successfully installed! To login to the admin area point your browser to http://yourwebsite.com/nucleus and login with your admin username and password!

This tutorial is part of the Install scripts that are present in fantastico tutorials category

b2evolution is a multi-lingual, multi-user, multi-blog publishing system written in PHP and backed by a MySQL database. It is distributed under the GNU General Public License and is available without charge. François Planque forked b2evolution from version 0.6.1 of b2\cafelog in 2003. One of the main differentiating features of b2evolution is its ability to manage multiple blogs under a single installation.

Main website: http://b2evolution.net/

Demo website: http://demo.b2evolution.net/

Support forums: http://forums.b2evolution.net/

Step 1: Head over to the Downloads section and download a release which is ticked.

Step 2: Extract the contents of the archive and upload the content of the Blogs folder to your webserver using a FTP client like SmartFTP.

Step 3: Head over to phpMyAdmin and create a database with the name blog or b2evolution.

Step 4: Once you have uploaded the contents of the Blogs directory direct your browser to http://yoursite.com/install/ to begin the installation process.

You will find explanations next to each field. Translations are also available in the bottom of the screen.

Step 5: On the next page select New Install: Install b2evolution database tables and tick

The script will setup the database tables and setup the script.

Step 6: Log in with the username admin and the automatically generated password(they are located in bottom of the page)

Step 7: delete the install folder from your webserver(this is for security purposes).

That’s it! you have successfully installed b2evolution blogging platform, and you are ready to start blogging. Head over to your admin panel and start exploring it!

If you are on a free host that doesn’t offer Cpanel with Fantastico as a control panel, or Elefante script installer you don’t have to be jelous on people who have free hosting from hosts that offer the autoinstallers mentioned above.

Most of all you should be proud of yourself because you can install those scripts manually, i bet that more than 3/4 of the people who use script autoinstallers have no idea how to install a script manually, possibly not even how to create and manage a database.

Back in 2005 i had hosting from a free webhost that offered FTP access, access to phpMyAdmin and a mysql database. I remember spending quite a long time reading FAQ’s and such till i figured out how to install blogs/cms’s and scripts, but eventually i learned it and that surely helped me in my webmaster career.

Thats why i decided to post tutorials on how to install the scripts that are located in Fantastico along with some other widely popular scripts.

These tutorials will help you get started, and in the end installing any script will be easy as pie!

This tutorial will teach you how to setup and manage a local webserver on your PC using XAMPP that you can use for testing scripts, programming,etc.

Having a webserver on your PC can greatly help you, since you can test out stuff on your local PC -> you don’t need to wait till files are uploaded to a webhost, if you make changes to files you don’t need to reupload them, and you have full access to php.ini file (where you can set php variables - SAFE MODE, REGISTER GLOBALS, etc) this meaning that you have no restrictions and you have full flexibility.

Ofcourse you can setup a webserver using the tougher way by downloading Apache, PHP , Perl , MYSQL , phpMyAdmin and setting up the server manually, defining the php variables and connecting phpMyAdmin with MYSQL

There are lots of packs that contain Apache,php,mysql,phpmyadmin:

Wampserver - http://www.wampserver.com/en/

XAMPP - http://www.apachefriends.org/en/xampp.html

PHP Triad - http://sourceforge.net/projects/phptriad/

EasyPHP - http://www.easyphp.org/

FoxServ - http://sourceforge.net/projects/foxserv/

OmniHTTPD - http://www2.stack.ru/~julia/PHP4/install.omnihttpd.html

You can choose any one of the ones written above, in this tutorial i will teach you how to install, setup and mantain a server that was created using XAMPP.

First of all lets check out all the features that XAMPP has:

  • Apache HTTPD 2.2.6 + Openssl 0.9.8g

- The Apache HTTP Server, commonly referred to simply as Apache, is a web server notable for playing a key role in the initial growth of the World Wide Web.

- OpenSSL is an open source implementation of the SSL and TLS protocols.

  • MySQL 5.0.51

- MySQL is a multithreaded, multi-user SQL database management system The basic program runs as a server providing multi-user access to a number of databases

  • PHP 5.2.5
  • PHP 4.4.7

- You can switch between the 2 versions of PHP, also note that suppoert for php 4.4.7 has been discontinued starting from 31st december 2007.

- PHP is a computer programming language originally designed for producing dynamic web pages.

- PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications.

  • phpMyAdmin 2.11.3

- phpMyAdmin is an open source tool written in PHP intended to handle the administration of MySQL over the Internet. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, and manage keys on fields.

  • FileZilla FTP Server 0.9.24

- FileZilla Client is a free, open source, cross-platform FTP client. It supports FTP, SFTP, and FTPS (FTP over SSL/TLS). As of August 10, 2007, it was the 12th most popular download of all time from SourceForge.net

  • Mercury Mail Transport System 4.52

- Mercury Mail Transport System (Mercury MTS) is a standards compliant donationware (was freeware prior to 2007-01) email server developed by David Harris, who also developed the Pegasus Mail client.

Lets begin with downloading XAMPP:

- Head over to http://www.apachefriends.org/en/xampp-windows.html and download the XAMPP installer

Just save the installer where ever you want(save it in a place where you will surely find it)

The installer is relatively small, it has 37MB, and it is hosted on sourceforge, this meaning that the transfer will be fast( i downloaded it with 230kb/s) so if you have a good internet connection you will have the installer in a matter for 1-2 minutes.

After download run the installer, here are the steps you need to follow:

1) Select the location where you want XAMPP to be installed(space used after installation is 200MB):

2) Select which services you want XAMPP to install( uncheck Filezilla, because you won’t use it) and hit “Install” button:

3) Sit back and wait till the installer does its job:

XAMPP will also configure PHP

4) Head over to the XAMPP Control Panel and check if everything is OK:

In case the status of Apache or MYSQL is STOPPED than press the start button and the service will start. Simple as pie :).

You can check out the status of the services by pressing the “Status” button:

You can access your local webserver by typing http://localhost/ in your browser’s address bar or http://127.0.0.1

IF everything is working fine after selecting the language you will find a page that will say:

Welcome to XAMPP for Windows Version 1.6.5 !

Congratulations:
You have successfully installed XAMPP on this system!

Now you can start using Apache and Co. You should first try »Status« on the left navigation to make sure everything works fine.

For OpenSSL support please use the test certificate with https://127.0.0.1 or https://localhost

For this release a special thanks to Uwe Steinmann for his excellent development and compilation of all current “Special” modules!

Good luck, Kay Vogelgesang + Kai ‘Oswald’ Seidler

Other stuff that you should know:

You can access phpMyAdmin at http://localhost/phpmyadmin/

You can test out your scripts by copying them to C:\xampp\htdocs

Your database server is: localhost

Your database user is: root

By default you don’t have a root password, to set a password open up C:\xampp\phpmyadmin\config.inc.php

Edit the line: MySQL user $cfg['Servers'][$i]['password'] = ”

After editing it should look like: MySQL user $cfg['Servers'][$i]['password'] = ‘yournewpassword’

You can change Safe mode, the register globals settings and other php flags in C:\xampp\php\php.ini

Good luck! And remember that the best webserver is http://localhost/ ;).