The following tutorial is a simple example of how to create a site crawl robot with php. This can be used for search engines, creating caches of your sites at regular intervals etc. The crawler uses php’s CURL library to fetch the URL contents. It will then look for an anchor tag inside the page […]
Archive for the ‘Php scripts and Tutorials’ Category
PHP code to create a calendar for the month
This code snippet will help you to create a calendar through a few lines of php code which you can easily style with simple css and html. You can easily create your php web based calendar in just two steps. You may ask why this is needed when many calendar scripts are out. You are […]
Recursively walk in a directory and delete all matched files with php
This simple code snippet will help you to recursively walk in a directory and delete all matched files. For example if you have a nested directory with around 10000+ folders and you want to remove all the .txt / .htaccess files inside that directory and sub directories, you ca use the following function. Copy and […]
How to get the IP address of users and Country, State and locations
Many times we have received the private mails requesting the help to track the IP address of the users. Here is a simple php code to get the IP address of the user. With a little addition to the code, you can get the location details of the user like Country, State and city. Please […]
Easily create short URLS with php, curl and goo.gl or bit.ly
The 140 character limit in twitter has made the necessity of URL shortner services. There are many URL shortening services available like http://goo.gl, http://bit.ly, http://ow.l etc.. You can even have your own short URL service, if you are so much worried about your brand. Deciding which type to use is surely a decision based on […]
Getting file extension with PHP
Here is a simple code snippet to get the extension of uploaded file via php 1] Method 1 $File_name = $_FILES[‘upload’][‘name’]; echo $File_extn = substr($File_name, strrpos($File_name, ‘.’)+1); 2] Method 2 Using php’s pathinfo() echo $ext = pathinfo($filename, PATHINFO_EXTENSION);
How to integrate paypal payment gateway with your websites.
Ever wondered how to integrate payment gateways like paypal for your sites? Team Webgalli ih having pretty good experience with php and paypal integration. If you need to integrate paypal with your site, drop us a mail and we can do that for you. We do both payment gateway and donation gateway. You can read […]