Featured Post Today
print this page
Latest Post

MySql Query For Filter | Search Bar Query FHXDJ7ENSTPM

MySql Query For Filter
Search Bar Query


MySql Query for filter. You can use this query for getting match values in your site. This search bar query is so simple to understand.

 $filter = "Sam";  
 SELECT * from contacts WHERE name LIKE '%".$filter."%' order by name"  

You just need to change "Name". You can use different field according to your need. It can either be "Title" or "Description". That is up to your database / script.

It is the best way to release your server load and good for your website ranking on Google.

Must Comment
0 comments

What is my IP address PHP Function? Simple Script

IP address PHP Function
IP address PHP Function

Now you can easily find IP address of user. You just need to put this bellow function to your PHP script. This is cool script to find IP address of user. check it

 function getipaddress()  
      {  
           if (!empty($_SERVER['HTTP_CLIENT_IP'])) {  
             $ip = $_SERVER['HTTP_CLIENT_IP'];  
           } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {  
             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];  
           } else {  
             $ip = $_SERVER['REMOTE_ADDR'];  
           }  
           return $ip;  
      }  
If you are not familiar with function, and want to learn that how to create function. Visit it.
If you are trying to find more simple code for IP Address.  Use this code in your page anywhere.

 <?php  
 $ip=$_SERVER['REMOTE_ADDR'];  
 echo "<b>IP Address = $ip</b>";  
 ?>   
It will make you easy to detect user Internet Protocol Address. And you can locate your IP address easily.
4 comments

All Country List Static Array in PHP With Drop Down Option

All Countries List
County List
There are about 242 counties in this world. May be I also don't know all names. But as developer, we may need to add country list in registration form. You can get complete country list as static array from QWC. You just need to copy code and paste to your site. If you are beginner then you need to learn about ForEach Loop to understand this code.
Complete Country List Code is available below.
 <?php  
 $countrylist = array(  
      'AD' => 'Andorra',  
      'AE' => 'United Arab Emirates',  
      'AF' => 'Afghanistan',  
      'AG' => 'Antigua and Barbuda',  
      'AI' => 'Anguilla',  
      'AL' => 'Albania',  
      'AM' => 'Armenia',  
      'AN' => 'Netherlands Antilles',  
      'AO' => 'Angola',  
      'AQ' => 'Antarctica',  
      'AR' => 'Argentina',  
      'AS' => 'American Samoa',  
      'AT' => 'Austria',  
      'AU' => 'Australia',  
      'AW' => 'Aruba',  
      'AZ' => 'Azerbaijan',  
      'BA' => 'Bosnia and Herzegovina',  
      'BB' => 'Barbados',  
      'BD' => 'Bangladesh',  
      'BE' => 'Belgium',  
      'BF' => 'Burkina Faso',  
      'BG' => 'Bulgaria',  
      'BH' => 'Bahrain',  
      'BI' => 'Burundi',  
      'BJ' => 'Benin',  
      'BM' => 'Bermuda',  
      'BN' => 'Brunei Darrussalam',  
      'BO' => 'Bolivia',  
      'BR' => 'Brazil',  
      'BS' => 'Bahamas',  
      'BT' => 'Bhutan',  
      'BV' => 'Bouvet Island',  
      'BW' => 'Botswana',  
      'BY' => 'Belarus',  
      'BZ' => 'Belize',  
      'CA' => 'Canada',  
      'CC' => 'Cocos (keeling) Islands',  
      'CD' => "Congo, Democratic People's Republic",  
      'CF' => 'Central African Republic',  
      'CG' => 'Congo, Republic of',  
      'CH' => 'Switzerland',  
      'CI' => 'Cote D Ivoire',  
      'CK' => 'Cook Islands',  
      'CL' => 'Chile',  
      'CM' => 'Cameroon',  
      'CN' => 'China',  
      'CO' => 'Colombia',  
      'CR' => 'Costa Rica',  
      'CS' => 'Serbia and Montenegro',  
      'CU' => 'Cuba',  
      'CV' => 'Cap Verde',  
      'CS' => 'Christmas Island',  
      'CY' => 'Cyprus Island',  
      'CZ' => 'Czech Republic',  
      'DE' => 'Germany',  
      'DJ' => 'Djibouti',  
      'DK' => 'Denmark',  
      'DM' => 'Dominica',  
      'DO' => 'Dominican Republic',  
      'DZ' => 'Algeria',  
      'EC' => 'Ecuador',  
      'EE' => 'Estonia',  
      'EG' => 'Egypt',  
      'EH' => 'Western Sahara',  
      'ER' => 'Eritrea',  
      'ES' => 'Spain',  
      'ET' => 'Ethiopia',  
      'FI' => 'Finland',  
      'FJ' => 'Fiji',  
      'FK' => 'Falkland Islands (Malvina)',  
      'FM' => 'Micronesia, Federal State of',  
      'FO' => 'Faroe Islands',  
      'FR' => 'France',  
      'GA' => 'Gabon',  
      'GB' => 'United Kingdom (GB)',  
      'GD' => 'Grenada',  
      'GE' => 'Georgia',  
      'GF' => 'French Guiana',  
      'GG' => 'Guernsey',  
      'GH' => 'Ghana',  
      'GI' => 'Gibraltar',  
      'GL' => 'Greenland',  
      'GM' => 'Gambia',  
      'GN' => 'Guinea',  
      'GP' => 'Guadeloupe',  
      'GQ' => 'Equatorial Guinea',  
      'GR' => 'Greece',  
      'GS' => 'South Georgia',  
      'GT' => 'Guatemala',  
      'GU' => 'Guam',  
      'GW' => 'Guinea-Bissau',  
      'GY' => 'Guyana',  
      'HK' => 'Hong Kong',  
      'HM' => 'Heard and McDonald Islands',  
      'HN' => 'Honduras',  
      'HR' => 'Croatia/Hrvatska',  
      'HT' => 'Haiti',  
      'HU' => 'Hungary',  
      'ID' => 'Indonesia',  
      'IE' => 'Ireland',  
      'IL' => 'Israel',  
      'IM' => 'Isle of Man',  
      'IN' => 'India',  
      'IO' => 'British Indian Ocean Territory',  
      'IQ' => 'Iraq',  
      'IR' => 'Iran (Islamic Republic of)',  
      'IS' => 'Iceland',  
      'IT' => 'Italy',  
      'JE' => 'Jersey',  
      'JM' => 'Jamaica',  
      'JO' => 'Jordan',  
      'JP' => 'Japan',  
      'KE' => 'Kenya',  
      'KG' => 'Kyrgyzstan',  
      'KH' => 'Cambodia',  
      'KI' => 'Kiribati',  
      'KM' => 'Comoros',  
      'KN' => 'Saint Kitts and Nevis',  
      'KP' => "Korea, Democratic People's Republic",  
      'KR' => 'Korea, Republic of',  
      'KW' => 'Kuwait',  
      'KY' => 'Cayman Islands',  
      'KZ' => 'Kazakhstan',  
      'LA' => "Lao People's Democratic Republic",  
      'LB' => 'Lebanon',  
      'LC' => 'Saint Lucia',  
      'LI' => 'Liechtenstein',  
      'LK' => 'Sri Lanka',  
      'LR' => 'Liberia',  
      'LS' => 'Lesotho',  
      'LT' => 'Lithuania',  
      'LU' => 'Luxembourgh',  
      'LV' => 'Latvia',  
      'LY' => 'Libyan Arab Jamahiriya',  
      'MA' => 'Morocco',  
      'MC' => 'Monaco',  
      'MD' => 'Moldova, Republic of',  
      'MG' => 'Madagascar',  
      'MH' => 'Marshall Islands',  
      'MK' => 'Macedonia',  
      'ML' => 'Mali',  
      'MM' => 'Myanmar',  
      'MN' => 'Mongolia',  
      'MO' => 'Macau',  
      'MP' => 'Northern Mariana Islands',  
      'MQ' => 'Martinique',  
      'MR' => 'Mauritania',  
      'MS' => 'Montserrat',  
      'MT' => 'Malta',  
      'MU' => 'Mauritius',  
      'Mv' => 'Maldives',  
      'MW' => 'malawi',  
      'MX' => 'Mexico',  
      'MY' => 'Malaysia',  
      'MZ' => 'Mozambique',  
      'NA' => 'Namibia',  
      'NC' => 'New Caledonia',  
      'NE' => 'Niger',  
      'NF' => 'Norfolk Island',  
      'NG' => 'Nigeria',  
      'NI' => 'Nicaragua',  
      'NL' => 'Netherlands',  
      'NO' => 'Norway',  
      'NP' => 'Nepal',  
      'NR' => 'Nauru',  
      'NU' => 'Niue',  
      'NZ' => 'New Zealand',  
      'OM' => 'Oman',  
      'PA' => 'Panama',  
      'PE' => 'Peru',  
      'PF' => 'French Polynesia',  
      'PG' => 'papua New Guinea',  
      'PH' => 'Phillipines',  
      'PK' => 'Pakistan',  
      'PL' => 'Poland',  
      'PM' => 'St. Pierre and Miquelon',  
      'PN' => 'Pitcairn Island',  
      'PR' => 'Puerto Rico',  
      'PS' => 'Palestinian Territories',  
      'PT' => 'Portugal',  
      'PW' => 'Palau',  
      'PY' => 'Paraguay',  
      'QA' => 'Qatar',  
      'RE' => 'Reunion Island',  
      'RO' => 'Romania',  
      'RU' => 'Russian Federation',  
      'RW' => 'Rwanda',  
      'SA' => 'Saudi Arabia',  
      'SB' => 'Solomon Islands',  
      'SC' => 'Seychelles',  
      'SD' => 'Sudan',  
      'SE' => 'Sweden',  
      'SG' => 'Singapore',  
      'SH' => 'St. Helena',  
      'SI' => 'Slovenia',  
      'SJ' => 'Svalbard and Jan Mayen Islands',  
      'SK' => 'Slovak Republic',  
      'SL' => 'Sierra Leone',  
      'SM' => 'San Marino',  
      'SN' => 'Senegal',  
      'SO' => 'Somalia',  
      'SR' => 'Suriname',  
      'ST' => 'Sao Tome and Principe',  
      'SV' => 'El Salvador',  
      'SY' => 'Syrian Arab Republic',  
      'SZ' => 'Swaziland',  
      'TC' => 'Turks and Caicos Islands',  
      'TD' => 'Chad',  
      'TF' => 'French Southern Territories',  
      'TG' => 'Togo',  
      'TH' => 'Thailand',  
      'TJ' => 'Tajikistan',  
      'TK' => 'Tokelau',  
      'TM' => 'Turkmenistan',  
      'TN' => 'Tunisia',  
      'TO' => 'Tonga',  
      'TP' => 'East Timor',  
      'TR' => 'Turkey',  
      'TT' => 'Trinidad and Tobago',  
      'TV' => 'Tuvalu',  
      'TW' => 'Taiwan',  
      'TZ' => 'Tanzania',  
      'UA' => 'Ukraine',  
      'UG' => 'Uganda',  
      'UM' => 'US Minor Outlying Islands',  
      'US' => 'United States',  
      'UY' => 'Uruguay',  
      'UZ' => 'Uzbekistan',  
      'VA' => 'Holy See (City Vatican State)',  
      'VC' => 'Saint Vincent and the Grenadines',  
      'VE' => 'Venezuela',  
      'VG' => 'Virgin Islands (British)',  
      'VI' => 'Virgin Islands (USA)',  
      'VN' => 'Vietnam',  
      'VU' => 'Vanuatu',  
      'WF' => 'Wallis and Futuna Islands',  
      'WS' => 'Western Samoa',  
      'YE' => 'Yemen',  
      'YT' => 'Mayotte',  
      'YU' => 'Yugoslavia',  
      'ZA' => 'South Africa',  
      'ZM' => 'Zambia',  
      'ZW' => 'Zimbabwe'  
 ); ?>  
 <html lang="us-en" xml:lang="us-en">  
   <head>  
           <style>  
                .form{  
                     margin:10px auto;  
                }  
                .form label, select{  
                     display:inline-block;  
                     float:left;  
                }  
                .form label{  
                     width:100px;  
                }  
                .body{  
                     width:400px;  
                     height:50px;  
                     background-color:#C33;  
                     padding:20 20 20 20;  
                     margin:300px auto;  
                }  
     </style>  
   </head>  
   <body>  
        <div class="body">  
       <form class="form">  
            <div><label for="usstates"><b>Countries:</b></label></div>  
              <div><select name="states" id="usstates">  
                     <option>Select Country</option>  
                               <?php  
               foreach($countrylist as $countrycode => $countryname)  
               {  
                 echo'<option value="'.$countrycode.'">'.$countryname.'</option>';  
               }  
             ?>  
                      </select>  
                          </div>  
                </form>  
     </div>  
      </body>  
 </html>  

If you are from USA also get US States List code.
4 comments

US States List Static PHP Array with Drop Down Option

US States List in PHP
PHP States List Code Result

US States List with Static Array in PHP with Drop Down Option. You just need to copy it and add to your site. For this code, you just need to learn ForEach Loop in PHP.

US States Array List In PHP


 <?php  
 $usstates = array(  
   'AK' => 'Alaska',  
   'AZ' => 'Arizona',  
   'AR' => 'Arkansas',  
   'CA' => 'California',  
   'CO' => 'Colorado',  
   'CT' => 'Connecticut',  
   'DE' => 'Delaware',  
   'DC' => 'District of Columbia',  
   'FL' => 'Florida',  
   'GA' => 'Georgia',  
   'HI' => 'Hawaii',  
   'ID' => 'Idaho',  
   'IL' => 'Illinois',  
   'IN' => 'Indiana',  
   'IA' => 'Iowa',  
   'KS' => 'Kansas',  
   'KY' => 'Kentucky',  
   'LA' => 'Louisiana',  
   'ME' => 'Maine',  
   'MD' => 'Maryland',  
   'MA' => 'Massachusetts',  
   'MI' => 'Michigan',  
   'MN' => 'Minnesota',  
   'MS' => 'Mississippi',  
   'MO' => 'Missouri',  
   'MT' => 'Montana',  
   'NE' => 'Nebraska',  
   'NV' => 'Nevada',  
   'NH' => 'New Hampshire',  
   'NJ' => 'New Jersey',  
   'NM' => 'New Mexico',  
   'NY' => 'New York',  
   'NC' => 'North Carolina',  
   'ND' => 'North Dakota',  
   'OH' => 'Ohio',  
   'OK' => 'Oklahoma',  
   'OR' => 'Oregon',  
   'PA' => 'Pennsylvania',  
   'RI' => 'Rhode Island',  
   'SC' => 'South Carolina',  
   'SD' => 'South Dakota',  
   'TN' => 'Tennessee',  
   'TX' => 'Texas',  
   'UT' => 'Utah',  
   'VT' => 'Vermont',  
   'VA' => 'Virginia',  
   'WA' => 'Washington',  
   'WV' => 'West Virginia',  
   'WI' => 'Wisconsin',  
   'WY' => 'Wyoming');  
 ?>  
 <html lang="us-en" xml:lang="us-en">  
   <head>  
           <style>  
                .form{  
                     margin:10px auto;  
                }  
                .form label, select{  
                     display:inline-block;  
                     float:left;  
                }  
                .form label{  
                     width:75px;  
                }  
                .body{  
                     width:250px;  
                     height:50px;  
                     background-color:#C33;  
                     padding:20 20 20 20;  
                     margin:300px auto;  
                }  
     </style>  
   </head>  
   <body>  
        <div class="body">  
       <form class="form">  
            <div><label for="usstates"><b>States:</b></label></div>  
              <div><select name="states" id="usstates">  
                               <?php  
               foreach($usstates as $statcode => $statname)  
               {  
                 echo'<option value="'.$statcode.'">'.$statname.'</option>';  
               }  
             ?>  
                      </select>  
                          </div>  
                </form>  
     </div>  
      </body>  
 </html>  
0 comments

Simple Login Page And Its Code For Creating Sassion


Here you can create user sassion and detect Login Errors by this form. Easy and simple code for newbies.
 <?php session_start(); ?>  
 <?php require_once("includes/connection.php"); ?>  
 <?php  
      if(!isset($_SESSION['username']))  
      {  
           $error= array();  
           if(isset($_POST['submit']))  
           {  
                //Get values from form  
                $username = $_POST['username'];  
                $password = $_POST['password'];  
                $query = "select * from users where username = '" . mysql_real_escape_string($username) . "'";  
                $query_run = mysqli_query($connection, $query);  
                if(!$query_run)  
                     echo 'username, password query is not working well. <br />' . mysqli_connect_error();  
                if(mysqli_num_rows($query_run) != 0 )  
                {  
                     $user = mysqli_fetch_array($query_run);  
                     if($username == $user['username'])  
                     {                      
                          if($password == $user['password'])  
                          {  
                               $_SESSION['username'] = $username;  //User session is created here
                               header("Location: index.php");  
                               exit;  
                          }  
                          else  
                          {  
                               array_push($error, 'password Wrong');  
                          }  
                     }  
                     else  
                     {  
                          array_push($error, 'Username Wrong');  
                     }  
                }  
                else  
                {  
                     array_push($error, 'Login Error');  
                }  
           }  
      }  
      else  
      {  
           header('Location: signup.php');  
           exit;  
      }  
 ?>  
 <div align="left" style="float:right">  
 <h2 align="center">Login Panel for Developer</h2>  
 <form method="post" action="login.php">  
      <label for="username">Username: </label><input name="username" type="text" id="username" /><br />  
   <label for="password">Password: </label><input type="password" name="password" id="password" /><br />  
   <input type="submit" name="submit" value="Login" />  
 </form>  
 <?php  
      if(isset($_POST['submit']))  
                {  
                     echo $error[0];  
                }  
           ?>  
 </div>  

0 comments

Updated Ping Website Multiple Service URLs

wordpress ping list If you are finding Updated Ping Website list. So you do not to worry about it. In QWC Collection you can find it easily. Ping Website List can keep update your website with all search engines and spiders. It is best way to drive more than more traffic on your site. Now you need to know that how can you use this Pink Website List for your Word Press Website, Please Follow the instruction.
  1. Open Your site Admin Panel Like : http://yoursite.com/wp-admin
  2. Now you need to go into your Weblog setting
  3. Go to your writing Option
  4. Check both boxes into Remote Publishing (Atom Publishing Protocol, XML - RPC Publishing Protocols)
  5. In Update Services You need to copy Ping Website List and Past This Ping Website List to there
  6. Now Save your setting
Whenever you update your site or update or post any post, your website will be updated to these bellow sites.

 http://rpc.pingomatic.com/  
 http://rpc.weblogs.com/RPC2  
 http://audiorpc.weblogs.com/RPC2  
 http://ping.blogs.yandex.ru/RPC2  
 http://rpc.bloggerei.de/ping/  
 http://rpc.odiogo.com/ping/  
 http://services.newsgator.com/ngws/xmlrpcping.aspx  
 http://api.my.yahoo.co.jp/RPC2  
 http://xmlrpc.bloggernetz.de/RPC2  
 http://xping.pubsub.com/ping  
 http://rpc.twingly.com  
 http://blog.youdao.com/ping/RPC2  
 http://www.blogsearch.google.ae/ping/RPC2  
 http://www.blogsearch.google.at/ping/RPC2  
 http://www.blogsearch.google.be/ping/RPC2  
 http://www.blogsearch.google.bg/ping/RPC2  
 http://www.blogsearch.google.ca/ping/RPC2  
 http://www.blogsearch.google.ch/ping/RPC2  
 http://www.blogsearch.google.cl/ping/RPC2  
 http://www.blogsearch.google.co.cr/ping/RPC2  
 http://www.blogsearch.google.co.hu/ping/RPC2  
 http://www.blogsearch.google.co.id/ping/RPC2  
 http://www.blogsearch.google.co.il/ping/RPC2  
 http://www.blogsearch.google.co.in/ping/RPC2  
 http://www.blogsearch.google.co.jp/ping/RPC2  
 http://www.blogsearch.google.co.ma/ping/RPC2  
 http://www.blogsearch.google.co.nz/ping/RPC2  
 http://www.blogsearch.google.co.th/ping/RPC2  
 http://www.blogsearch.google.co.uk/ping/RPC2  
 http://www.blogsearch.google.co.ve/ping/RPC2  
 http://www.blogsearch.google.co.za/ping/RPC2  
 http://www.blogsearch.google.com.ar/ping/RPC2  
 http://www.blogsearch.google.com.au/ping/RPC2  
 http://www.blogsearch.google.com.br/ping/RPC2  
 http://www.blogsearch.google.com.co/ping/RPC2  
 http://www.blogsearch.google.com.do/ping/RPC2  
 http://www.blogsearch.google.com.mx/ping/RPC2  
 http://www.blogsearch.google.com.my/ping/RPC2  
 http://www.blogsearch.google.com.pe/ping/RPC2  
 http://www.blogsearch.google.com.sa/ping/RPC2  
 http://www.blogsearch.google.com.sg/ping/RPC2  
 http://www.blogsearch.google.com.tr/ping/RPC2  
 http://www.blogsearch.google.com.tw/ping/RPC2  
 http://www.blogsearch.google.com.ua/ping/RPC2  
 http://www.blogsearch.google.com.uy/ping/RPC2  
 http://www.blogsearch.google.com.vn/ping/RPC2  
 http://www.blogsearch.google.com/ping/RPC2  
 http://www.blogsearch.google.de/ping/RPC2  
 http://www.blogsearch.google.es/ping/RPC2  
 http://www.blogsearch.google.fi/ping/RPC2  
 http://www.blogsearch.google.fr/ping/RPC2  
 http://www.blogsearch.google.gr/ping/RPC2  
 http://www.blogsearch.google.hr/ping/RPC2  
 http://www.blogsearch.google.ie/ping/RPC2  
 http://www.blogsearch.google.it/ping/RPC2  
 http://www.blogsearch.google.jp/ping/RPC2  
 http://www.blogsearch.google.lt/ping/RPC2  
 http://www.blogsearch.google.nl/ping/RPC2  
 http://www.blogsearch.google.pl/ping/RPC2  
 http://www.blogsearch.google.pt/ping/RPC2  
 http://www.blogsearch.google.ro/ping/RPC2  
 http://www.blogsearch.google.ru/ping/RPC2  
 http://www.blogsearch.google.se/ping/RPC2  
 http://www.blogsearch.google.sk/ping/RPC2  
 http://www.blogsearch.google.us/ping/RPC2  
 http://api.my.yahoo.com/RPC2  
 http://ping.bloggers.jp/rpc/  
 http://blog.goo.ne.jp/XMLRPC  
 http://ping.weblogs.se/  
 http://blogmatcher.com/u.php  
 http://coreblog.org/ping/  
 http://www.blogpeople.net/servlet/weblogUpdates  
 http://bulkfeeds.net/rpc  
 http://trackback.bakeinu.jp/bakeping.php  
 http://ping.myblog.jp  
 http://ping.bitacoras.com  
 http://ping.blogmura.jp/rpc/  
 http://xmlrpc.blogg.de  
 http://1470.net/api/ping  
 http://bblog.com/ping.php  
Share your love with us and keep update with us
0 comments
 
Copyright © 2011-2026. Samee Articles - All Rights Reserved
Proudly powered by Blogger