Featured Post Today
print this page
Latest Post

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

How to use signature file in outlook?

Create your signature (.HTML / .HTM) file with the help of xHTML and CSS save file in your system. (.HTM file recommended)
like


Samee Ullah Feroz
(Web Analyst)
Email:Sam@QWC.Me
Skype: Samee2cool
Gtalk: SEO.Getacho@gmail.com
Web:www.Getacho.com
Community:Jokes Community
Contact Me On Social Media
Facebook
Twitter
LinkedIn
Google Plus
Resume








  1. Now open Run by Win+R
  2. Write : %AppData% click enter
  3. Open Microsoft Folder
  4. Then Signature folder.
  5. Paste your signature file in this filder. 
Now you need to change the extension from .html to .htm
  • so you need to click alt.
  • Menu bar will visible.
  • In Tools => Folder Options
  • Open View tab and uncheck Hide extensions from unknows files.
  • now you can easily rename your file. 

Open your outlook, when you need to click on signature and add your signature in your email.

0 comments

Slug Create Function in PHP. URL Rewriting According to SEO Rules

SEO friendly Slug is very important in Search Engine Optimization. It is used to rewrite your URL as your title.
as if you write title: "My Name Is Sami" And if it is a page. Then
Its URL will be :
www.QWC.me/?page=1 [1 Is Page ID]

If you use title in URL it can be like it
www.QWC.me/?page=my20%name20%is20%sami

But if you use slug function: URL will be SEO friendly like

www.QWC.me/?page=my-name-is-sami

There are many function: I am going to add 2 good functions for it. there is no any personal PHP built in function.

1:
 function slug($str, $replace=array(), $delimiter='-')  
      {  
           if( !empty($replace) )  
      {  
           $str = str_replace((array)$replace, ' ', $str);  
      }  
           $clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);  
           $clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean);  
           $clean = strtolower(trim($clean, '-'));  
           $clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean);  
           $clean = form_validation($clean);  
           return $clean;  
 }  


2:
 function slug2($string){  
   $slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string);  
   return $slug;  
 }  
0 comments

Get Row Data in Tables from MySQL

This small code is used by Pakistan Floor Mills. Here you can easily understand that how to show rows data from your database to your table in front end.
Use it and learn from it.

insert data form
This code will tell you how to get data from array and how to show in fields.
Setup a database connection with following code.
 -- phpMyAdmin SQL Dump  
 -- version 4.0.4  
 -- http://www.phpmyadmin.net  
 --  
 -- Host: localhost  
 -- Generation Time: Nov 12, 2013 at 06:49 PM  
 -- Server version: 5.6.12-log  
 -- PHP Version: 5.4.16  
 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";  
 SET time_zone = "+00:00";  
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;  
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;  
 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;  
 /*!40101 SET NAMES utf8 */;  
 --  
 -- Database: `asia`  
 --  
 -- --------------------------------------------------------  
 --  
 -- Table structure for table `test`  
 --  
 CREATE TABLE IF NOT EXISTS `test` (  
  `sno` int(4) NOT NULL,  
  `packing` varchar(20) NOT NULL,  
  `weight` int(4) NOT NULL  
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;  
 --  
 -- Dumping data for table `test`  
 --  
 INSERT INTO `test` (`sno`, `packing`, `weight`) VALUES  
 (1, 'Ghee 16 kgs', 16),  
 (2, 'Ghee 10 kgs', 10),  
 (3, 'Ghee 5 kgs', 5);  
 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;  
 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;  
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;  

phpmysql
See this SQL file Image
Get Row Data in Tables from MySQL
Now when you press this button results should be here. like that
code is here check it.

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BROWSE DATA </title>

 <style type="text/css">
 
 html {
 overflow:auto;
 }
 
 body {
 background-color:#FFFFFF;
 margin:0 auto;
 }
 
  
 #mypopup2
 {
 float: left;
 width: 250px; height: 350px;
 background: #90bade; 
 border: 1px solid #069;
 text-align:center;
 padding:2px;
 margin-top:150px;
 margin-left:50px;
 overflow:auto;
 }
 
 
 #header
 {
 background-color:#3399FF;
 background-position:left center;
 line-height:25px;
 font-size:22px;
 color:#FFFF33;
 font-weight:600;
 border-bottom:1px solid #6699CC;
 padding:10px;
 }
 
 .design12 {
 background-image:url(Images/disk.png);
 background-position:left center;
 background-repeat:no-repeat;
 background-color:#FF9;
 border:1px solid #88de85;
 -webkit-border-radius:7px;
 -moz-border-radius:7px;
 font-size:15px;
 font-weight:700;
 font-family:verdana;
 color:#0d5f83;
 width:100px;
 cursor:hand;
 padding:9px;
 }
 
 .design13 {
 background-image:url(Images/reload_16.png);
 background-position:left center;
 background-repeat:no-repeat;
 background-color:#CF9;
 border:1px solid #88de85;
 -webkit-border-radius:7px;
 -moz-border-radius:7px;
 font-size:15px;
 font-family:verdana;
 font-weight:700;
 color:#0d5f83;
 width:100px;
 cursor:hand;
 padding:9px;
 }
 
 
 .txt
 {
 width:150px;
 font-family:Arial, Helvetica, sans-serif;
 font-size:14px;
 font-weight:300;
 }
 
 td
 {color:#6600CC;}
 
 </style>
    
    <!-- PHP Code START -->

<?php 

 if(isset($_POST['submit']))
 {
  // Connection variables 
  $host="localhost"; 
  $username="root"; 
  $password=""; 
  $db_name="asia";  
  
  // Connect to database 
  $con = mysqli_connect($host, $username, $password); 
  
  // Connect result 
  if(!$con)
  { 
   die('Error Connecting to Database: ' . mysqli_connect_error()); 
  } 
  
  // Database Selection 
  $sel = mysqli_select_db($con, $db_name); 
  
  // Database Selection result 
  if(!$sel)
  { 
   echo ('Error selecting Database: ' . mysqli_connect_error()); 
  } 

    $query  = 'select * from test';
      $result = mysqli_query($con, $query);
    $count = mysqli_num_rows($result);
    $row = mysqli_fetch_array($result);  
    
   if(!$result)
    echo 'select query error or data not found'; 

   }  
   else
   {
 $i = '';
 $count = '';
  $row = array('sno' => '', 'packing' => '', 'weight' => '');
   }
   ?>
 <!-- PHP Code END -->

 </head>
 
 <body>

 <div id="mypopup2" >
 <div id="header"><img src="Images/book_open.png" align="left">Browse Data</div>
 <div style="margin-top:10px;">

 <form name="form1" method="POST" action="#">
 
 <table border="1" cellpadding="1" cellspacing="1" bgcolor="silver" align="center" width="95%" >
    
 
 <th width="20%">Code</th>
 <th width="50%">Product</th>
 <th width="20%">Weight</th>
    <?php 
  if(isset($_POST['submit']))
  {
   $i = 1;
   while($i <= $count)
    {
       echo"<tr>";
     echo "<td>" . $row['sno'] . "</td>";
     echo "<td>" . $row['packing'] . "</td>";
     echo "<td>" . $row['weight'] . "</td>";
     echo "</tr>";
     $row = mysqli_fetch_array($result); 
     $i++;
    } 
  }


   echo "</table><br>";

 ?>
 </table>
 

 <div style="margin-top:125px;text-align:center;margin-top:100px;">
    <input type="submit" name="submit" value="Brow" class="design12">
 <input type="submit" name="button2" value="Clear" class="design13">
    </div>
 </form>
 </div>
 </div>
</body>
</html>

Result Output is :
Get Row Data in Tables from MySQL

Now it is your turn read this code, understand it and align it yourself by using great CSS skills.
0 comments
 
Copyright © 2011-2026. Samee Articles - All Rights Reserved
Proudly powered by Blogger