Facebook Twitter Reset

Extract domain name from url using php

parse_url is a built in php function which can be used to parse url and get the type of request like whether its http or https or ftp, gives the domain name like www.google.com and path and the query. below is the sample code < ?php $url...

How to use Namespaces in php 5.3 ?

How would you differentiate if the call save() was to save a blogs or save comments? The solution was to use blog_save() or comment_save() before the introduction of classes in which we could write the save() function within the Blog class or...

How to get the IP address of the visitor with PHP?

This is a very simple script to get the IP address of your visitor using php < ?php $ip = $_SERVER['REMOTE_ADDR']; echo "Your IP address is ".$ip; ?> VN:F [1.9.13_1145]please wait...Rating: 1.0/10 (1 vote cast)VN:F [1.9.13_1145]Rating:...

Simple Visitor Counter Using php

This tutorial require 1 PHP file and 1 table of mySQL database. 1. counter.php 2. Database “mypage” and table “counter” with 1 fields: visitor(Int, 11). You need to insert a first one record with “0″. Counter.php Source...

Export MySQL to CSV (Excel) using php

You can export your MySQL database to .csv file format (Microsoft Excel file) easily using php. This tutorial require 1 PHP file and 1 table of mySQL database. 1. exportcsv.php 2. The table is with 2 fields: id(auto_increment), name(varchar,...

Import large files in mysql using PhpMyAdmin

Sometimes when trying to upload some huge SQL file using PHPMYADMIN  we might come across this ERROR MESSAGE Error: You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit There is...

Fix Too many connections mysql_connect

If you get a Too many connections error when you try to connect to the mysq server, then it clearly means that all available connections are in use. Too Many Connections can be caused by either a lot of simultaneous connections or by old connections...

Remove Non-Alphanumeric Characters using php

This is a very simple code to remove non alphanumeric charecters from a variable using php. THE CODE < ?php $str = "Here! are some numbers 1244 and some non alphanumeric charecters !£$%^&"; $new_string = preg_replace("/[^a-zA-Z0-9\s]/",...

Apache AddHandler application/x-httpd-php not working?

Some times the AddHandler application/x-httpd-php .php .htm .html .my whatever if you put this in .htaccess file or in HTTPD.conf it seems to be not working. WHY? Because sometimes especially if you are using a shared hosting it will be always...

Get textbox value from dropdown using ajax and php

This is a simple tutorial on how to get a dropdown list value using simple ajax and php Create a html page named country.html and add the below codes, HTML CODE <select name="country" onChange="getCurrencyCode('find_ccode.php?country='+this.value)"> ...

Quick method to prevent cross site scripting in php

Let’s define a simple function to prevent the querysting from being tampered with external code. Lets take an example, If you have a webpage like http://www.mistonline.in/search/index.php?name=java , there is every possiblity that a hacker...

Avoid direct access to a file in php enhanced version

Some months before i have written a code to avoid the direct access of files using php, but now i have modified the previous script since it has some set backs, Let us take one file named MYFILE.PHP as an example, all you have to do is just...

Force download files using php

Hello guys here is a simple yet powerful script that allows you guys to force the users download some files with the dialog box Do you want to open or save the file, just copy paste the script below. <?php header(“Content-type:application/octect-stream”); header(‘Content-Disposition:...
Affordable Seo PackagesSeo BlogEdu Backlinks