Archive for February, 2010
UK Postcodes Complete Database Table – Import and Enjoy
on February 19, 2010
1. Download this file and import it into your database. Postcodes.txt 2. Rename Postcode.txt to Postcode.sql 3. Import to your database and enjoy complete list of UK Postcodes. Here is the sample code: CREATE TABLE IF NOT EXISTS `postcodes` ( `id` int(11) NOT NULL auto_increment, `postcode` tinytext NOT NULL, `grid_n` varchar(15) NOT NULL, `grid_e` varchar(15) NOT NULL, `latitude` varchar(15) NOT NULL, `longitude` varchar(15) …
How to Get All URLs From a Page / Paragraph?
on February 19, 2010
<?php $string = ‘<a href="http://www.test.com">test.com</a> has many links with tests <a href="http://www.test.net/file.php">links</a> to many sites and even urls without links like http://www.test.org just to fill the gaps and not to forget this one http://www.imjan.com/php-interview-questions/curl-register-your-domain-but-check-its-availability/ which has a space after it. The script has been modifiied from its original so now it grabs ssl such as https://www.test.com/abc.php also’; function getAllUrls($string){ $regex = ‘/https?\:\/\/[^\" ]+/i’; …
What Does PHP Stand For?
on February 18, 2010
PHP is short form of “Hypertext Preprocessor”.
How to Earn Money on the Internet?
on February 18, 2010
Google says :- “Google Adsense is the program that can generate promotion revenue from each page on your website—with a minimal investment in time and no additional resources. Google is not only a great search engine but with the release of “adsense” it can also pay for your hosting/domain and if you work hard even your holidays Adsense delivers relevant ads that are …
How to Change DIV Contents in Javascript?
on February 17, 2010
Its very easy to change the contents of div in javascript. Just get the object of div using getElemementbyID() or getElementbyName() and use innerHTML property with the new value. divObj = document. getElementbyID("mydiv"); divObj.innerHTML = ‘<p>This is a html code</p>’;
What Are the Advantages of CURL Library?
on February 17, 2010
PHP supports libcurl is a library that allows you to connect and communicate to many different types of servers with many different types of protocols. LIBCURL (CURL LIBRARY PHP) currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. LIBCURL (CURL LIBRARY PHP) also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s …
Using Javascript to POST Data Between Pages
on February 17, 2010
The following is a simple example of how to submit data from one HTML page to another using the POST method from Javascript. Normally, if data needs to be sent from one HTML page to another, it is done by appending the information to the query parameter of the the URL in the familiar “name=value†format. e.g. <a href="post.aspx?user=peter&cc=aus">Click</a> Although this works fine, …
How Do I Get a User's IP Address in PHP?
on February 17, 2010
echo $_SERVER['REMOTE_ADDR'];
How to Connect to MySQL Database Using PHP?
on February 17, 2010
<?php $username = "your_name"; $password = "your password"; $hostname = "localhost"; $dbname = "database name"; //Connection to the MySql Database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); mysql_select_db("$dbname",$db); echo "Connected to MySQL"; ?>
How to Get Domain Name From any URL in php?
on February 16, 2010
function getOnlyDomain($url) { $myurl = ereg_replace(‘www\.’,”,$url); $domain = parse_url($myurl); if(!empty($domain["host"])){ return $domain["host"]; } else { return $domain["path"]; } }//end funciton echo getOnlyDomain(‘http://www.imjan.com/php-interview-questions/using-php-curl-to-read-and-write-rss-feed-xml/’);

