Recent Articles
Seo Tips & Tricks : Get indexed in google very fast
Jul 14, 2009 Seo Tips & Tricks 5 Comments
I’ve heard this question too many times to stay without telling this amazing unique seo trick / tip.
You may know that doing social bookmarking, forum posting, getting an article to a popular blog, etc. will help getting indexed faster in google.
But, pay attention, no other trick than opening an adwords campaign with your site will make it go into google’s cache faster.
It simply doesn’t matter how much money you put, 1.00$ or 100$, etc.
Enjoy!
Dynamically create an image from any text in PHP
Jun 29, 2009 Useful PHP 4 Comments
My goal when I did this quick script was to use php to convert text into images, so that email addresses could be dynamically inserted into pages, making spam harvesters’ life a little harder.
Of course it has many more uses, one of them being to avoid web spiders from fetching a specific word or two -say a promo code you don’t want to be indexed.
To run this script you must have GD library installed. We’ll take parameters via GET and put that text into the image:
<?php if(!isset($_GET['text'])) { die("No text provided"); } header ("Content-type: image/png"); $textToConvert = $_GET['text']; $font = 4; $width = ImageFontWidth($font) * strlen($textToConvert); $height = ImageFontHeight($font); $im = @imagecreate ($width,$height); $background_color = imagecolorallocate ($im, 255, 255, 255); //this means it's white bg $text_color = imagecolorallocate ($im, 0, 0,0);//and of course black text imagestring ($im, $font, 0, 0, $textToConvert, $text_color); imagepng ($im); ?>
Save this as texttoimage.php and then when you want to create the image, link to it in an ‘img’ tag.
<img src="texttoimage.php?text=emailAddress@emailProvider.com">
Hey, be warned, the above won’t stop spammers and spiders from fetching your email address! They’ll see and properly parse the query string -this is for demonstration purposes only.
Find Browser Name and Capabilities in PHP
Jun 28, 2009 Useful PHP 3 Comments
To get the browser name just use this line:
<?php print $_SERVER['HTTP_USER_AGENT']; ?>
And to get all the browser’s features use:
<?php print_r(get_browser(null, true));//null for user agent and true to receive an array ?>
Ventrilo Server Hosting
Jun 22, 2009 Uncategorized Leave a comment
Ventrilo is a voice over IP program that allows multiple people to communicate with each other over an internet connection. You have a choice of audio codecs like Speex and GSM, Ventrilo is based on the client-server model, the client will reside on your computer and the server will relay all of the data from the other clients to your computer. Ventrilo server hosting is fairly affordable, starting at $2.91 per month for 10 users.
Ventrilo is a great utility for development teams who like to keep in touch without having to deal with IM programs.
It stuff : PHP ByPass Captcha Code
Jun 19, 2009 It Stuff 1 Comment
Sounds exactly what you want ? Are you damn curious about how to bypass captcha with php? Me too, and, I’ve found a very interesting set of functions which does that for you. Go to http://pastebin.com/f1560d747
You’ll see it’s requesting an api key you may get right here http://www.captchakiller.com/
Good Luck!
I have not tested it yet, you may let me know how is it by commenting!
PHP Tutorial : Country list array
Jun 17, 2009 Useful PHP 2 Comments
In my point of view, a very useful and common thing we need when we build for example a membership site it’s country list array. I will do it within next function then will show how to use it :
Click here to get the function
And here’s how to use it for example to generate a select (drop down) with options to list countries:
<?php $countryList = countryArray(); print "<select name=\"countryList\">"; foreach($countryList as $simbol => $country) { print "<option value=\"$simbol\">$country</option>\n"; } print "</select>"; ?>
Simply useful! But have also a look here: http://readytousesolutions.com/phpblog/tag/php-detect-country/
PHP Tutorial : List function
Jun 16, 2009 Useful PHP 2 Comments
Beeing surprised that I didn’t write here about this “cute” php function called list(). I like it a lot, it’s like the extract() function in some way if you remember.
The list() php function will assign variables in one shot to strings from arrays.
<?php //here's the php array $countingArray = array(1,2,3); //here, the list function will convert 1 to $one variable, 2 to $two and 3 to $three list("one", "two", "three") = $countingArray; print "I am counting $one, errr I think it comes $two, and lastly $three"; //should print I am counting 1, err....comes 2 and lastly 3 ?>
How Shared Web Hosting is a Better Option?
Jun 15, 2009 It Stuff 16 Comments
A web server is a device that allows you to present your website over the internet. Only a few companies afford to pay a huge amount to encompass an entire web server, named as dedicated web hosting. The other small and medium sized organizations can not afford such big sums. The option of shared or cheap web hosting is always open for such small scale companies.
Understanding shared hosting one can reveal that more than one websites can be hosted on a single server on which web space on the hard disc is divided among all the websites hosted on that server. It means that a number of websites use the same server to save their data. There is some necessary information that everyone must collect before choosing a shared or cheap web hosting.
Like, is the shared web hosting worthwhile? What is the maximum number of websites that can use a hard drive? Are the server activities affected by increasing the number of hosted websites?
There is no limit of hosted websites on a single server, theoretically. As the web servers cost very high, everyone would like to host as many site as they can. This is actually beneficial for the web hosting providing company to host a large number of sites on a single server; however, for the website owner’s point of view it is not a good practice to host the website on a server that contains a lot of websites. Some of the experienced webmasters believe that it less depend on the number of websites, there is a possibility that only a single large website may occupy all the CPU and RAM space. So, there is a need to know which websites are hosted on that shared web server on which you are going to host your website.
PHP Tutorial : Results Pagination
Jun 15, 2009 Complete Scripts 5 Comments
Among the most common tasks for a php CMS writer is to handle pagination.
Pagination is needed when there are many entries in the database and they can not be shown in a single page of results. A pagination navigation bar gives the user the ability to see a smaller list of entries.
Pagination is not as easy as it seems, expecially when dealing with seo friendly urls or multi language sites. However here’s a solution for pagination in php. Simple and up to the point:
First, we calculate the total amount of entries. Then the numbers of pages needed to show everthing. And, of course, we need to know how many results are to be displayed per page. Finally, we’ll print out the entries and links for next, previous and each individual page number.
MySql LIMIT clause accepts either one or two values. In this example we use two so it returns values between -say- 10 and 20. If you only use one value, as in LIMIT 10, it will return the first 10 results.
The second value is a quantity, not an index!
In other words, don’t do LIMIT 0,10 then LIMIT 10,20 then LIMIT 20,30: it won’t work. Instead, use LIMIT 0,10, LIMIT 10,10, LIMIT 20,10.
<?php //include database connection (check previous posts to get this one) >include('dbConnection.php'); //get the number of total rows $query = "SELECT * FROM TableName"; $result = mysql_query($query); // Number of records found $num_record = mysql_num_rows($result); // Number of results per page $display = 5; if(isset($_GET['page'])) { $currentPage = $_GET['page']; }else{ $currentPage = 1; } //last page - we use ceil because page range is 1 to Max, this way page "2.5" becomes page 3 $lastPage = ceil($num_record/$display); //limit in the query thing $limitQ = 'LIMIT ' .($currentPage - 1) * $display .',' .$display; //normal query and print results $query = "SELECT * FROM TableName $limitQ"; $result = mysql_query($query); //here you do your loop like >while($row=@mysql_fetch_object($result)) { print "$row->FieldName"; } //pagination navigation (links) //previous >if ($currentPage == 1) { print "Prev "; } else { print "<a href=pagename.php?page=1>First page</a> "; $previousPage = $currentPage-1; print "<a href=pagename.php?page=$previousPage>Previous</a>"; } print " { Page $currentPage of $lastPage } "; //for next pages links >if ($currentPage== $lastPage) { print "Next last"; } else { $nextPage = $currentPage+1; print " <a href=pagename.php?page=$nextPage>NEXT</a> "; print " <a href=pagename.php?page=$lastPage>LAST</a> "; } ?>
Now you can use this pagination to split your mysql results into multiple webpages, but there are better ways to handle this problem, as we’ll see in the future: keep in mind that right now we are reading all values every time, and this may burden our script. A better way would be to pre-count the number of results and then select only those we are going to show.
Also, for something like a comment page, an ajax pagination approach would probably be better. Again, we’ll get back at this in another tutorial -as always drop a comment if there is something you’d like to see explained more in depth.
Feedburner Feed
Jun 14, 2009 It Stuff Leave a comment
Hi,
This is a request for people reading my feed or who already subscribed.
Please use the feedburner feed so I will be able to see how many guy’s are following.
FEEDBURNER URL :
http://feeds2.feedburner.com/crivionweb/kRHa

