Archive for the ‘PHP’ Category

How to check Link popularity or back links for a domain in php

Tuesday, April 20, 2010 5:06 2 Comments

How to check Link popularity or back links for a given domain in php?
Link popularity is a measure of the quantity and quality of other web sites that link to a specific site on the World Wide Web. It is an example of the move by search engines towards off-the-page-criteria to determine quality content. In [...]

This was posted under category: PHP Tags: , , , , ,

Get a domain name’s IP address with PHP

Friday, April 9, 2010 7:36 10 Comments

How to get Domain name’s IP address with PHP ?.
It’s very easy to get the IP address for a domain name using PHP. We have two powerful functions in php to get the IP address of a domain name.
Those functions are

gethostbyname()
gethostbynamel()

The first one will return  IP address corresponding to a given Internet host [...]

This was posted under category: PHP Tags: , ,

How to know Mysql Version Using PHP

Thursday, April 8, 2010 2:11 1 Comment

How to know Mysql Version Using PHP ?.
We can know the mysql version in the phpinfo. But if we want to display the mysql version in any web page dynamically, how we are you going to deal with that ?.
A little bit logic and a liitle bit manipulation on the phpinfo information we can achieve [...]

This was posted under category: Mysql, PHP Tags: , ,

How to connect to FTP and upload file using php code?

Saturday, April 3, 2010 3:15 No Comments

How to connect to FTP and upload file using php code?
The following code will connect to the ftp and upload the file to the server using php code

<?php

$ftp_server=”HOST NAME”;
$ftp_user_name=”USER NAME”;
$ftp_user_pass=”PASSWORD”;
$conn_id = ftp_connect($ftp_server);

// login with username and password

$login_result = ftp_login($conn_id, “$ftp_user_name”, “$ftp_user_pass”);

if ((!$conn_id) || (!$login_result)) {
echo “authentication failed”;
}
else
{

$source_file=”uploads/”.$fileName;
$destination_file=”/htdocs/”.$fileName;
$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

}

ftp_quit($conn_id);

?>

This was posted under category: PHP Tags: ,

Display all PHP Errors and Warnings

Saturday, March 20, 2010 1:14 3 Comments

How do i display errors in php if error display setting is off in my server configuration?
Here are the two simple things to display errors even if the error display setting is off in server.

error_reporting(E_ALL);
ini_set(’display_errors’, ‘1′);

This was posted under category: PHP Tags: , ,

How to Redirect from Your Root Domain to the WWW Subdomain

Wednesday, February 17, 2010 2:14 17 Comments

How to Redirect from Your Root Domain to the WWW Subdomain and Vice Versa Using mod_rewrite?
Most websites stick to one form of their domain name when they refer to their own site, be it the plain domain name, like example.com, or the www form, like www.example.com. Unfortunately others linking to you don’t always follow your [...]

This was posted under category: PHP

404 redirect using htaccess

Wednesday, February 17, 2010 2:05 3 Comments

How do I make it so instead of a 404, the home page or any specified page comes up?
Here is simple trick for that ..
You will probably want to create an error document for codes 404 and 500, at the least 404 since this would give you a [...]

This was posted under category: PHP Tags: , , , ,