Featured Post Today
print this page
Latest Post
Subscribe To Our Newsletter

Sign Up Now To Get Free Coupon Codes, Event Coupon Codes Updates, Offers Updates. It's 100% Free!

We Hate Spam! Really, It's terrible and we never do it.

Showing posts with label Download PHP Scripts. Show all posts
Showing posts with label Download PHP Scripts. Show all posts

Date List Static Array with PHP Function Drop Down

Date list static array can help you to design contact form in offline mood. With this code, you can add dates in your form without using API system.

 <?php   
      $date = array(   
      '1'=>'1',  
      '2'=>'2',  
      '3'=>'3',  
      '4'=>'4',  
      '5'=>'5',  
      '6'=>'6',  
      '7'=>'7',  
      '8'=>'8',  
      '9'=>'9',  
      '10'=>'10',  
      '11'=>'11',  
      '12'=>'12',  
      '13'=>'13',  
      '14'=>'14',  
      '15'=>'15',  
      '16'=>'16',  
      '17'=>'17',  
      '18'=>'18',  
      '19'=>'19',  
      '20'=>'20',  
      '21'=>'21',  
      '22'=>'22',  
      '23'=>'23',  
      '24'=>'24',  
      '25'=>'25',  
      '26'=>'26',  
      '27'=>'27',  
      '28'=>'28',  
      '29'=>'29',  
      '30'=>'30',  
      '31'=>'31');   
 ?>   
  <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="dates"><b>date:</b></label></div>   
        <div><select name="date" id="dates">   
                 <?php   
         foreach($date as $dates => $datenow)   
         {   
          echo'<option value="'.$dates.'">'.$datenow.'</option>';   
         }   
        ?>   
            </select>   
              </div>   
         </form>   
    </div>   
    </body>   
  </html>   

0 comments

PHP | Login Form | User Will Redirect According To Category

mysql database user category

Login Form Code As Category System:

Sometime you have to redirect user according to his category / position to specific page. So, here this login form code can help you. It is simple code and localhost tested.

 <?php  
  //header('location: index.php');  
  //session_start();  
 function confirm_query($data)  
      {  
           if(!$data)  
                die("Query Failed: " . mysqli_connect_error());       
      }  
 $username = $_POST['username'];  
 $password = $_POST['password'];  
 $host = "localhost";  
 $dbuser = "root";  
 $dbpass = "";  
 $db = "estate";  
      $con = mysqli_connect($host, $dbuser); //Connection with server  
      confirm_query($con);  
      $connection = mysqli_select_db($con, $db); //Database is connected here  
      confirm_query($connection);  
 if(isset($_POST['submit']))  
 {  
      $query = "SELECT * FROM users where username = '{$username}' and password = '{$password}';";  
      $all_users = mysqli_query($con, $query);  
      if(!$all_users)  
           echo 'user pass query not working;' . mysqli_connect_error();  
      $user = mysqli_fetch_array($all_users);  
      if(mysqli_num_rows($all_users) != 0)  
      {  
           if($username == $user[username] AND $password == $user[password])  
           {  
                if($user[Category] == "Receptionist")  
                {  
                     $_SESSION['username'] = $username;  
                     header("location: receptionist.html");  
                     exit;  
                }  
                //Example Like uncomment and change.   
                //make sessions and add code start_session(); in all pages start.  
                /*elseif($user[Category] == "Receptionist")  
                {  
                     $_SESSION['username'] = $username;  
                     header("location: receptionist.html");  
                     exit;  
                }*/  
           }  
      }  
 }  
 else  
 {  
      header("location: login.html");  
      exit;  
 }  
 ?>  

2 comments

SEO Offpage Working With Mega Pack 2013-2014 Available | Crack, Null, License, Portable


Best SEO Tool
There are two categories of SEO, off page SEO and on page SEO. Both are necessary for any web site. In this article we are describing about off page SEO. Through SEO you can convey and improve traffic at your site. 
While on-page optimization focuses on your web formation and a content of your web, off-page optimization focuses on methods to optimize your site which doesn't engage changing your site content and formation, or with your website's pages doing everything at all; which is identified "off-page optimization." Here are several methods used in off-page optimization. Off-page optimization techniques are normally all about spreading and advertising link on your site.
1. Link exchanges
It is else known as link building, and link fame. Link exchanging is absolutely free technique of making lots of visitors to your site by just exchanging links with further sites. You promote their site and they support your website.
2. Directory Submissions
If you have a web site, then you have to submit your web link to other sites so that your web’s rank can increase day by day by clicking of lots of visitors. There are so many good PR directories site on the net for you. So many sites need some charge via pay pal but lots of sites are offering free listing. Some of the sites take charge as a membership fee. The main important thing with those listening is having a good article show long time at your site and could take many clicks.
3. Web Analytics
This web analyzes will consider your website's visibility, potential audience, and skill to draw attention online.
Some times you need to use SEO tools and plugins. SEO tools can provide you benefit if you know how to use them.
We Can provide you following Mega pack tools
 Ask for Full Cracked Seo Tools Free

1
1clickcashbot

A
AAC Trackback Submitter 6
ActiveCampaign Email Marketing
AdQuick 2.1
AdSense Firestorm
Adsense Goldmine 3.3
AdText Generator 2.2.6
Advanced Emailer 6.9
AffiloTheme 4.0.1529
Affpressor
All In Scraper 1.1.39
All-In-One SEO Pack PRO 1.74.00
All In One Protector 4.03
Amaniche 3.0
aMember Pro 4.2.3
Analytic Call Tracking
Answer Analyst 1.443
Answer Assault 2.0.1.0
Answer Eye Pro 13
Article Architect
Article Bot 2.0
Article Marketing Robot 1.1.0.7
Article Spinner 3.0.2.0
Article Submitter 2.0
Article Submitter Plus 1.1.0
Artisteer 3.0
Atomic Email Hunter 3.50
Atomic Mail Sender 4.27
AI Roboform Enterprise 7.8.4.5
Authority Link Software 1.4
Authority Pro 2
Auto Hide IP 5.3.0.2
Auto Keyword Robot
Auto Social Poster Pro 3.9
Auto Tube Press
AutoBlogged 2.9.1
AutoBlog Samurai Pro
Automated Webinar Generator
AutoPligg Desktop 6.0.1.8
Autopress Pro 1.0.9

B
Backlink Booster
Backlink Energizer 1.6
Backlink Index Expressbie 9
Backlink Power Indexer
Backlink Profit Monster 3.0.4
Backlink Skyrocket 1.5.3
Backlink Topia Pro 3.3.2.0
Backlink Speed 2.4
Backlinker 3.4
Backpage Autoposter
BackupBuddy 3.0.38
Backup Creator
Best Instagram Bot 4.1
Blackhat Viral WP Plugin
Blog Bot 1.0
Blog Post Automator
Blogger Zon Poster 2.9.9
Botstagram 1.1.8.0
Bookmarking Demon 5.6.1.3
Brute Force SEO EVO2

C
Camtasia Studio 8.0
Captcha Infinity
Captcha Sniper X2
CB Goliath 4.1.5
ClassiPress 3.1.5
ClickBump SEO
Comment Ninja 0.6
Comment Scrape Boss
Content Mania
Content Solution
Content Revenge 2.06
Content Samurai
CouponPress 6.2.2
CPA Blaster 1.96
Craigslist Mailer 2.0.1.0
CTR Theme 1.4.15
Curation Fire

D
Deep Linker Pro 2.0 [BONUS]
Digi Article Blaster
Digi Auto Links 2.1.5
Digi Exit Pop
Digi Launchpad 1.3
Digi Link Doctor 1.3.1
Digi List Builder 1.6
Digi Social Squeeze 1.1
Digi Traffic Accelerator
Digi Traffic Mulitplier 1.5.2
Digital Access Pass 4.3.1
Digital Product Demon
Directory Submitter 4.0
DL Guard 4.6
DoFellow
Domain Name Dominator

E
Easy Azon
Easy Redirect Script 4.0
Easy Spin Master Pro
Easy Video Player 2.2 [BONUS]
Easy Webinar Plugin
Easy WP SEO 1.7
ECrawl 2.60
Email Search Crawler 2.75
Email Sender Deluxe 2.34
Exit Splash
Exit Splash 2.2.5 WordPress
Extreme Traffic Bot
Extreme Wiki Poster 1.2.4
EZ Fanpage Generator 2.02.05
EzWPCloner

F
Facebook Blaster Pro 11
Facebook Friend Adder
Facebook Friend Commenter 5.5
Facebook iFrame PRO
Facebook Like Jacker
Fake Hits Generator 2.0
Fast Blog Finder
Fast Email Extractor 7.5
Fast Email Sender 5.0.0.0
Fast Member
FB Creator 3.0
FB Like Viral 1.2.1
FB Tube Pro
Fiverr Script 3.8
FlexSqueeze 1.5
Forum Bot 2.6
Forum Poster 3.30
Fresh Store Builder 2.6.3 [BONUS]
Friend Adder Elite 2.0.2

G
Get Article Pro
Ghost CPA
Gigsterr Bot
Godaddy Auctions PR Checker
Google Adsense Accelerator Plugin
Google Plus Extreme
GPScraper
Gravity Forms 1.6.5.1
GSA Email Spider 5.30

H
HeatMap PRO 5.2
HMA Proxy Grabber 2.0
Hotmail Account Creator
Hot Item Finder 2.1.0.7

I
Internet Business Promoter 12
Internet Download Manager 6.12
IgniteSEO 3.3.0
IM PowerSuite
IM Slave Link Blaster 1.1 [BONUS]
iMacros 8.02.1970
InstaBuilder
InstaFlow
Instant Articles Suite 1.10
Instant Article Wizard 3.086
Instant Backlink Magic 2.1a
Instant Social Anarchy 1.5
Instant Video Articles
Interspire Email Marketer 6.1.3
Interspire Shopping Cart 6.1.8
iPhorm 1.3.1

J
JakoDorgen Pro
JitBit Help Desk

K
Keyword Domainizer 1.9.0.27
Keyword Elite 2.0.18
Keyword Fighter 4.0
Keyword Mass 1.07
Keyword Ninja
Keyword Prodigy
Keyword Revenge 2.0.0.2
Keyword Scout 1.0.23
Keyword Snatcher 1.21
Keyword Sniper Pro 2.10.1020
Keyword Xtreme 3.0.24
Kontent Bot
Kontent Machine 2.14
K-Soft RSS Submit 3.0

L
LeadPlayer [BONUS]
Licorne AIO 2.4
Link Automatic WP Plugin
Link Farm Evolution 1.9.2
Link Thunder
Long Tail All versions
LinxBot 2.0
Live Email Verifier 6.0

M
MachForm 3.2
Magic Affiliate Plugin 1.7.3
Magic Members 1.5.23
Market Samurai 0.92.17
Mass Link Poster
Mass Video Blaster 2.16
Maxprog Email Extractor 3.5
Mega Robot Bomber
Member Speed 2.0
Micro Cash Machines
Micro Niche Finder 5.5.7
Miracle Traffic Bot
Movie Site Press 2.0
MyReviewPlugin 5.0

N
Niche Finder Mobile 1.0.20.0
Niche Site Builder
Ninja Pinner 1.4.1
No Hands SEO 1.7.16.0

P
Page Expiration Robot Pro 2.1.5
Pagelines Framework 2.2.5
Paypal Download Manager 6.44
Penguinizer XP
PHP MyVideoBlog Pro 3.2.95
PiiBot 1.6
Pin Blaster 1.37
Pin Presser
PingAutomatic 2.0
Pingback Optimizer 2.8
PingFM Poster
PinMe Script 1.7
PinPal Bot 3.1.0.7
Pintastic 1.0.6
PinZon 1.8
Platinum Hide IP 3.2.2.8
Plus One Profits WP Plugin
PopUp Domination 3.0 [BONUS]
PopUp Ninja 2.0
Power Lead Snatcher 1.0.0.7
Power SEO Ranker 1.0.4.0
Power Submitter
PressBot
Pro Affiliate 2.0.2
Profits Theme 1.1.6
Proxy Goblin 2.5.8 Rev1
Proxy Multiply 1.0.0.64
Proxy Server Finder 1.09
Proxy Switcher Pro 5.5
PR Plunder 3

R
Rankbook Twitter Friend Suite Pro 3.1
RankBuilder 2.9.93
Rank Builder NEO 1.0.21
Rank Leap PRO 1.0.19
RSS Link Bomber 2.1.14

S
SB Bomber 1.2.26
Scrapebox Scheduler
Screaming Frog SEO Spider 2.01 [BONUS]
SE Sniper 1.5
SecureDL 1.4.2
SendBlaster 2.0.132
Senuke XCr 3.0.42
SenukeX Bio Spinner V2
SEO Article Generator 2.0.1
SEO Elite 4
SEO Link PRO
SEO Link Robot 2.1.5.0
SEO PowerSuite Enterprise [BONUS]
SEO Smart Links
SEO Studio Enterprise 2.04.30
SEOPressor 4.x
SEOPressor 4.3.09
SEOPressor 5.x
Share2See 1.4
Sick Submitter 4.019
SliQ Submitter Plus 3.5.0.0
Snagit 11
Social App Creator 2.2
SocialBot 5.0
SocialBacklinker Pro
Social Engine 4.2.4
Social Infuse
Socrates Theme 3.03
Spinner Pro
Squeeze Boss
Stealth Keyword Analyzer 2.3.4
Stealth Keyword Digger 1.3
Sublime Twitter Bot 1.0.27
SubscriptionMate 1.2
SuperPress Plugin

T
The Action Machine 3.0
The Best Spinner 2.9
The Traffic Player Pro
The Tweet Tank
Theme Revenge
Thesis 1.8.4 [BONUS]
Traffic Accumulator 1.0.0
Traffic Juicer 1.6.8.0
Traffic Monster
Traffic Phoenix 1.6
Traffic Travis Pro 4.1
Tube Digger 2.2.1
Tube Increaser 5
Tube Smasher
TubeToolbox 2.13.5.1
Tubenoia
TubeSpy
Tweet Adder 3.0
Tweet Attacks Account Creator
Tweet Attacks Pro 3.4
TweetSpice 1.1.36.0.0
Twitter Blaster Pro 3.01
Twitter Scraper 1.1

U
uBot Studio v.3 [BONUS]
Ultimate Exit Pop Up
Ultimate Niche Finder 1.4.35.29
Ultimate Page Maker
Unlimited Sitemap Generator 4.0

V
Venom SEO 1.1.5
Video Bot
Video Marketing Blaster 1.35
Video Marketing Dominator Pro
Video Prospector Pro 1.8.0.2
Video Shadow 1.3
Video Spin Blaster 2.87
VIP Help Desk 3.03
VIP Shopping Cart 4.0
Viral Traffic Maximizer

W
Web Content Studio
Web Harvy 1.5.0.26
Web Traffic Genius Pro 3.6.21
Wicked Article Creator 2.3
WikiAssault 1.0.0.1
Wiki Bomber 1.0.5.21
Wikibot
WikiNuke 1.0.7
Win Automation 4.0.0.1256
WishList Member 2.60
WordTwit Pro Unlimited
WordPress Pinterest Automatic 1.2.0
WP4FB 2.0 Unlimited
WP Ads Back
WP Backup Plus
WP Cash Plus 2.0
WP Classifieds 6.3.2
WP Clicks 1.2.5
WP Cloaker
WP Contact Pro
WP Coupon Generator [BONUS]
WP eMember 7.4.1 [BONUS]
WP FacePages 4.2.0
WP Fan Pro 2.0
WP Graphics Pro
WP Lead Gorilla
WP Linkizer Elite
WP List Catcher
WP Local Places 1.3.2
WP ManagerDX
WP Member Champ
WP Pop Wizard
WP Profit Topper
WP Pro Local 2
WP Review Stars Plugin
WP Robot 3.66
WP Sales Letter 1.1.7
WP SEO Automation
WP SEO Domination 1.4
WP SEO Ninja
WP ShareMe
WP Short Codes Deluxe
WP Simplicity
WP Snippets Magic
WP SnowBall 1.0.6
WP Social Toolbar PRO 1.2 [BONUS]
WP Subscribers 1.40
WP Super Popup Pro
WP Syndicator
WP Tagizer
WP Touch Pro 2.70
WP Traffic Ninja
WP Traffic Tools 3.8.8.3
WP Turbo 1.3
WP Tweet Bomb 1.6.9.6
WP Twin 2.70
WP Unique 2.7
WP Video Affiliate Pro
WP Viral Rater 3.0
WP Whitehat Wizard
WP Zon Builder 2.5s
WPsBox Pro 3.1.0
WYSIWYG Web Builder 8.5.2

X
X-Cart Pro 4.5.2
XFileSharing Pro 1.8
XGen SEO 1.0.71.0
xGramBot 1.0.3.6
Xrumer 5.09 Palladium

Y
YellaBot 2.4.03
YouBooster Pro
YouTubeGet 5.9.11

Z
Zenno Poster PRO
Comment bellow we'll send you tools and that will be available for 3 hours only. If any software is not listed. Please comment bellow I have almost all SEO softwares. Any plugin, module, extension, add-on, script, file, theme, tools please comment bellow.
thanks
17 comments

PHP | Detect User Browser Language

How to detect user browser language and how to use it in URL.
If you add this script above your file code.
Then url will be :
  • www.domain.com/index.php?lang=en
  • www.domain.com/index.php?lang=ar
  • www.domain.com/index.php?lang=es
  • www.domain.com/index.php?lang=fr
  • www.domain.com/index.php?lang=hu
  • www.domain.com/index.php?lang=ra
 Region wise. and you can use this to multilingual website.

 <?php  
 //Redirect by language  
 $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);  
 if(!isset($_GET['lang']))  
 {  
      //Retrieve location, set time  
      if(!isset($lang))  
      {  
           header("location: ".$_SERVER['PHP_SELF']);  
           exit;  
      }  
      else  
      {  
           header("location: ".$_SERVER['PHP_SELF']."?lang=".$lang);  
           exit;  
      }  
 }  
 ?>  

0 comments

Convert XML to PHP Array | Multilingual + Country wise SEO URL Solution

Multilingual + Country wise SEO URL Solution:

Example
http://www.getacho.com/index.php?loc=pk&lang=en
Here I did deep research that how can I use PHP for Multilingual websites?
But we need to keep in mind some topics like
  1. User IP Address Function
  2. User Language Function
  3. IP to XML
  4. XML to PHP Array Conversion
  5. URL Concept
  6. Language And Area codes concept
If you know these things then, you can use this function easily.

 <?php  
 //Redirect by language  
 $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);  
 $context = stream_context_create(array('http' => array('header' => 'Accept: application/xml')));  
 //redirect by IP  
 $_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];  
 $ip = $_SESSION['ip'];  
 $data = file_get_contents("http://api.hostip.info/get_html.php?ip=".$ip."&position=true");  
 $arrayofdata = explode("\n", $data);  
 $country = explode(":", $arrayofdata[0]);  
 $count = explode(" ", $country[1]);  
 if(!isset($_GET['lang']) AND !isset($_GET['loc']))  
 {  
      //Retrieve location, set time  
      if(empty($count))  
      {  
           header("location: index.php?loc=us-en&lang=".$lang);  
           exit;  
      }  
      else  
      {  
           header("location: index.php?loc=".strtolower(trim($count[2],"()"))."&lang=".$lang);  
           exit;  
      }  
 }  
 ?>  

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.
5 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

Online Database Creation PHP Code with SQL Contribution

Now you don't need to browse PHPMyAdmin for creating database user password by database wizard. You just need to upload this files on your server and create database automatically.

1st file is style sheet file. : stylesheet.css

 @charset "utf-8";  
 /* CSS Document for : http://www.QWC.Me */  
 #dbcreation{padding-left:30%; padding-right:30%; padding-top:10%; padding-bottom:20%;}  
 table{border-top-left-radius:25; border-top-right-radius:25;}  
 th{text-align:center; background-color:#999;}  
 table, th, td, tr, thead, tbody{padding: 10px;}  
 a{text-decoration:none;}  
 .error{color:red;}  
 #dbinstall{border:10; border-color:#999; border-top-left-radius:25; border-top-right-radius:25; border-bottom-left-radius:25; border-bottom-right-radius:25; padding-left:30%; padding-right:30%; padding-top:10%; padding-bottom:20%;}  
 #signupform{text-shadow:#999; padding-left:30%; padding-right:30%; padding-top:10%; padding-bottom:20%;}  

2nd file is Database Values Taken File : create_database.php

 <?php  
      session_start();  
 ?>  
 <!DOCTYPE html >  
 <html xmlns="http://www.w3.org/1999/xhtml" lang="us-en">  
 <head>  
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
 <link rel="stylesheet" href="css/stylesheet.css" />  
 <title>Database Creation Process</title>  
 </head>  
 <body>  
   <div id="dbcreation">  
     <table align="center">  
          <thead>  
            <tr><th colspan="2" align="center">Enter Database Detail</th></tr>  
       </thead>  
       <tbody>  
         <form action="install.php" method="post">  
         <tr><td><label id="host">Host: </label></td><td><input type="text" name="host" placeholder="i.e. locahost" required="required" /></td></tr>  
         <tr><td><label id="dbname">Database Name: </label></td><td><input type="text" name="dbname" required="required" /></td>  
         <tr><td><label id="dbuname">User Name: </label></td><td><input type="text" name="dbuname" placeholder="i.e. root" required="required" /></td>  
         <tr><td><label id="dbpass">Password: </label></td><td><input type="text" name="dbpass" required="required" /></td>  
         <tr><td colspan="2" align="center"><input type="submit" name="submit" Value="Create" required="required" /></td></tr>  
         </form>  
       </tbody>  
     </table>  
   </div>   
 </body>  
 </html>  


3rd file is Database installation file : install.php

 <?php  
      session_start();  
 ?>  
 <!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=utf-8" />  
 <link rel="stylesheet" href="css/stylesheet.css" />  
 <title>Database Installation Process</title>  
 </head>  
 <body>  
 <div id="dbinstall">  
   <?php       
                //Get values from create_database.php files  
                if(isset($_POST['submit']))  
                {  
                     echo '<form method="post">  
                     <input type="hidden" name="host" value="'.$_POST['host'].'">  
                     <input type="hidden" name="dbname" value="'.$_POST['dbname'].'">  
                     <input type="hidden" name="dbuname" value="'.$_POST['dbuname'].'">  
                     <input type="hidden" name="dbpass" value="'.$_POST['dbpass'].'">  
                     <input type="submit" name="install" value="Install" align="center">  
                     </form><br/>';   
                     echo 'Welcome to installation process....<br/>  
                     Click install Button to install database.....<br />';  
                }                 
                //if user click on install button then install database on site  
                if(isset($_POST['install']))  
                {            
                     $dbhost = $_POST['host'];  
                     $dbname = $_POST['dbname'];  
                     $dbuname = $_POST['dbuname'];  
                     $dbpass = $_POST['dbpass'];  
                     //connect to mysql server for connecting server : need to give local host and user name  
                     $connect = mysqli_connect($dbhost, 'root');                 
                     //database creation.   
                     $db_create_query = "Create database " . $dbname;  
                     $database = mysqli_query($connect, $db_create_query);  
                     //database creation query error show  
                     if(!isset($database))  
                          {  
                               die("<div class=\"error\">Database creation query error : " . mysqli_connect_error() . "</div>");  
                          }  
                     //database users password query creation  
                     $dbuserpass = "create user " . $dbuname."@".$dbhost. " identified by '".$dbpass."'";  
                     $dbuserpass2 = mysqli_query($connect, $dbuserpass);  
                     //database users password query Error  
                     if(!isset($dbuserpass2))  
                          {  
                               die("<div class=\"error\">Database Username Password query error : " . mysqli_connect_error() . "</div>");  
                          }  
                     //give grant privileges to database user pass  
                     $previleges = "GRANT ALL PRIVILEGES ON $dbname. * TO '$dbuname'@'$dbpass' WITH GRANT OPTION";  
                     $previleges2 = mysqli_query($connect, $previleges);  
                     //check previleges error  
                     if(!isset($previleges2))  
                          {  
                               die("<div class=\"error\">Database Username Password query error : " . mysqli_connect_error() . "</div>");  
                          }                      
                     else  
                          {  
                               echo "Database has been created successfully<br />  
                                         Database Name :" . $dbname. "<br /> Database User Name : ".$dbuname."<br /> Database Password : ".$dbpass;  
                          }  
                }  
                session_destroy();  
      ?>  
 </div>  
 </body>  
 </html>  


I hope you will learn from it. copy code and check it

1 comments

Complete Self Controlled Form : Full Validations and Features with $_POST[] Method

According to new research, many hackers are working together to hack many sites. Now everyone is familiar with PHP, xHTML, CSS working and they can hack your form by
  • Save page as
  • Code checking
  • Firebug tool
  • Ctrl+U
So you need to make your contact form secure to safe your information..
I made this form to make your site more secure.
This form consists on some parts:
  1. Validate Function
  2. Values Validating
  3. Characters Limit Error Message
  4. Left Field Error Message
  5. Auto Selected fields after redirection
  6. CSS
  7. Form Fields
  8. Form Results
  9. Form Error Message
This form is divided into parts, anyone can easily understand it.
In this form : characters limit is
 'name' => 20, 'number' => 16, 'email' => 35,'subject' => 50, 'message' => 350, 'website' => 50

You can change it according to yourself.


  <?php  
           #######################################  
           #   Form Validation Function Start    #  
           #######################################  
      function form_validation($input)  
      {  
           $input = trim($input);  
           $input = htmlspecialchars($input);  
           $input = stripcslashes($input);  
           return $input;  
      }
   function validate_number($input_number)
   {  
   $input_number = preg_match ("/^[0-9]*$/", $input_number);
   $input_number = trim($input_number);  
            $input_number = htmlspecialchars($input_number);  
            $input_number = stripcslashes($input_number);
   return $input_number;
   }
   function validate_name($input_name)
   {  
   $input_name = preg_match("/^[a-zA-Z ]*$/", $input_name);
   $input_name = trim($input_name);  
            $input_name = htmlspecialchars($input_name);  
            $input_name = stripcslashes($input_name);
   return $input_name;
   }
   function validate_email($input_email)
   {  
   $input_email = preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $input_email);
   $input_email = trim($input_email);  
            $input_email = htmlspecialchars($input_email);  
            $input_email = stripcslashes($input_email);
   return $input_email;
   }
   function validate_web($input_web)
   {  
   $input_web = preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i", $input_web);
   $input_web = trim($input_web);  
            $input_web = htmlspecialchars($input_web);  
            $input_web = stripcslashes($input_web);
   return $input_web;
   }
   
           ######################################  
           #   Form Validation Function end     #  
           ######################################  
 /*--------------------------------------------------------------------------------*/  
           ####################################################
           #   Getting All Values and Validating them Start   #  
           ####################################################
                $error_msg = ""; //this variable for error massage  
    $departments = array(); //this array for saving department
                $name = $number = $email = $birth = $gender = $subject = $website = $select = $message = $color = ''; // we show all variables empty  
           ###############################################################  
           #   Submit Button Processing with secure validation Start     #  
           ###############################################################                      
                
    if(isset($_POST['submit']))  
                {  
                     $fields = array('name', 'number', 'email', 'birth', 'gender', 'departments', 'select', 'website', 'subject', 'message', 'color'); // all values field array  
      $errors = array(); //this array for saving errors 
                     foreach ($fields as $field) //this is for getting values  
                     {  
                          if(!isset($_POST[$field]) || $_POST[$field] == '' && $field != 'color') //if field value is empty or has nothing  
                          {  
                               array_push($errors, $field); //then selective field array value will be saved in error array.  
                          }  
                          else //if submit button has run, then it else will run  
                          {  
                               if($field != 'departments') //but if value is other than department field  
                               {  
                                    $$field = form_validation($_POST[$field]); //It will go through user define function and value will be made variables  
                               }  
                               elseif($field == 'departments') //but if value is about department then  
                               {  
                                    $departments = array(); //we define an array to save department values  
                                    $test_dept = $_POST[$field]; //we get department here  
                                    foreach($test_dept as $dept ) //we used departments parameter to save that on dept  
                                    {  
                                         array_push($departments, form_validation($dept)); //department will be fully validate and saved to department array  
                                    }  
                               }
                          }
        if($field == 'select' && $_POST[$field] == 'Navigation')
        {
         !array_push($errors, form_validation($field));
        }
                     } //this is foreach loop end  
                ##################################################  
                #   Getting All Values and Validating them end   #  
                ##################################################  
                ###########################################################################  
                # If No Error than Check characters Limit and show exceed Massage Start   #  
                ###########################################################################           
                          //As we have saved error values in errors array  
                     if(empty($errors) || !empty($errors))  
                     {  
                          //we define a assosiative array to define characters limit  
                          $fields = array('name' => 20, 'number' => 16, 'email' => 35,'subject' => 50, 'message' => 350, 'website' => 50);   
                          //For checking lenght we need to add a loop  
                          foreach($fields as $field => $length) //foreach loop is used for arrays : $field => $length we used for assosiative array  
                          ## in this $field => $length : $length variable as assigned to values  
                          {  
                               if (strlen($_POST[$field]) > $length)  
                               {  
                                    array_push($errors, $field . ' field characters limit has exceeded.'); //we shall use $field variable here,   
                                    # Because we are not using $fields, we are using $field as referance.   
                               }
          if($field == 'number' && !validate_number(($_POST[$field]))) //it is to validate number field.
          {
           array_push($errors, $field . " is not proper number."); //if there is an error in number field , error would be push on error array
          }
          if($field == 'name' && !validate_name(($_POST[$field]))) //it is to validate number field.
          {
           array_push($errors, $field . " is not proper name."); //if there is an error in number field , error would be push on error array
          }
          if($field == 'email' && !validate_email(($_POST[$field])) && !empty($_POST[$field])) //it is to validate number field.
          {
           array_push($errors, $field . " is not proper email."); //if there is an error in number field , error would be push on error array
          } 
          if($field == 'website' && !validate_web(($_POST[$field])) && !empty($_POST[$field])) //it is to validate number field.
          {
           array_push($errors, $field . " is not proper website link."); //if there is an error in number field , error would be push on error array
          } 
                          }  
                     } //it is if emtpy end  
                ########################################################################## 
                # If No Error than Check characters Limit and show exceed Massage End    #  
                ##########################################################################      
                ##################################################### 
                # If Error than then show the errors fields start   #  
                ##################################################### 
                     if(!empty($errors))  
                     {  
                          $error_msg = '<b>There are errors in following fields:</b> <br />';  
                          $error_msg .= implode('<br />', $errors);   
                     } //it is if not empty end  
                #########################################################  
                # If Error than then show the errors fields end         #  
                #########################################################  
                } //if isset POST['submit'] end  
           ###############################################################  
           #   Submit Button Processing with secure validation End       #  
           ###############################################################                      
 ?>  
 <!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" lang="us-en">  
 <head>  
 <title><?php $pagetitle="Self Controlled Form : Full Contact Form Feachers : Samee Ullah Feroz";
      define("blogname","www.QWC.me");
     echo $pagetitle ." : ". blogname; ?></title>
               <meta name="description" content="<?php echo $pagetitle ?> : Buy it." />
               <link rel="icon" type="image/ico" href="http://www.iconarchive.com/download/i50954/deleket/3d-cartoon-vol3/Web-Coding.ico" alt="Icon" />

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<style>
/*html
    {
        height:100%;
        width:100%;
        background:url(http://www.southsoft.co.za/images/mysql.jpg) center center no-repeat;
        background-position:center;
 You can also give local file path
    }*/
a:link 
    {
        color:#00F;
        text-decoration:none;
    }

body
    {
  color:#0000FF;
  font-family:"Courier New", Courier, monospace;
  /*background-image:url(http://www.getacho.com/download/phpcss/images/bg-color.png);
  background-repeat:repeat;
  background-attachment:fixed;*/
    }
    
 
#main
 {
  color: #0000FF;
  overflow: auto;
  padding: 10px;
  width: 100%;
 }
 
ul
 {
  
  list-style:square url("images/sqpurple.gif");
 }
#table_bg   
 {  
   border:0;  
   border-color:#000;   
      border-collapse:separate;  
   padding:3;
   padding-right:100px;
 }
.sidemsg  
 {  
      margin-top:60px;
   font-family:"Courier New", Courier, monospace;  
      font-size:16px;  
 }  

</style>               
 </head>  
 <body style="background-color:<?php echo $color?>; ">  
           <div id="main">
           <h1 align="center">Secure Self Controlled Contact Form.</h1> 
           <h2>Qualities</h2>
           <ul>
           <li>Secure from Hackers</li>
           <li>Fast Processing</li>
           <li>Single File Contact Form</li>
           <li>Show Error on characters limit exceeded</li>
           <li>Show Error on Wrong Name</li>
           <li>Show Error on Wrong Email</li>
           <li>Show Error on Wrong Website</li>
           <li>Show Error on Wrong number</li>
           <li>Numbers only digits not doubles</li>
           <li>Cannot select future date of birth</li>
           <li>Can select background custom color</li>
           <li>Can select required Department</li>
           <li>Can select required Agent</li>
           <li>HTML, Javascript etc. Don't work</li>
           <li>After getting errors, form will not reset</li>
           </ul>
           <blockquote>This form is coded to keep away your site from <b>Hackers</b>.</blockquote>
           <h2>Price</h2>
           <hp>You can purchase this form in 5$ just.</hp> 
           <b>Samee is Online On</b><br />
           <b>Company Site : </b><a href="http://www.getacho.com" target="_blank">Getacho Company</a><br />
           <b>Facebook : </b><a href="http://www.facebook.com/sameeullah.feroz" target="_blank">Samee Ullah Feroz</a><br />
           <b>Gtalk :</b> <a href="mailto:seo.getacho@gmail.com" target="_blank">SEO.Getacho</a><br />
           <b>Skype : </b><a href="skype:SEO.Getacho?call">SEO.Getacho</a><br />
           
           </div>
           <div id="table_bg">
               <table style="background-color:<?php echo $color?>; width: 100%;" align="center" >  
               <form action="self_controlled_form.php" method="post" >  
                    <tr><td><label for="name"><strong>Full Name:</strong></label></td>  
                    <td><input type="text" name="name" placeholder="Full Name" style="width:250px;" value="<?php echo $name;?>" /></td></tr>  
                    <tr><td><label for="number"><strong>Personal Number:</strong></label></td>  
                    <td><input type="text" name="number" placeholder="00923234223945" style="width:250px;" value="<?php echo $number;?>"/></td></tr>  
                    <tr><td><label for="email"><strong>Email:</strong></label></td>  
                    <td><input type="text" name="email" placeholder="i.e. mail@example.com" style="width:250px;" value="<?php echo $email;?>"/></td></tr> 
                    <tr><td><label for="website"><strong>Website:</strong></label></td>                   
                    <td><input type="text" name="website" placeholder="i.e. www.example.com" style="width:250px;" value="<?php echo $website;?>"/></td></tr                
                    ><tr><td><label for="gender"><strong>Your Gender:</strong></label></td>  
                    <td><input type="radio" name="gender" value="Male"   
                    <?php if($gender == 'Male' && !empty($gender))echo 'checked';?>/>Male  
                    <input type="radio" name="gender" value="Female"   
                    <?php if($gender == 'Female' && !empty($gender))echo 'checked';?>/>Female</td></tr>
                    <tr><td><label for="birth"><strong>Your DOB:</strong></label></td>                  
                    <td><input type="date" name="birth" value="<?php echo $birth;?>" max="<?php echo date();?>" min="1991-01-01" /></td></tr>  
                    <tr><td><label for="departments[]"><strong>Contact Departments:</strong></label></td>  
                    <td><input type="checkbox" name="departments[]" value="Marketing Department"   
                    <?php if(in_array('Marketing Department', $departments)&& !empty($departments))echo 'checked';?>/>Marketing Department <br /> 
                    <input type="checkbox" name="departments[]" value="Development Department"   
                    <?php if(in_array('Development Department',$departments)&& !empty($departments))echo 'checked';?>/>Development Department <br /> 
                   <input type="checkbox" name="departments[]" value="Finance Department"   
                    <?php if(in_array('Finance Department', $departments) && !empty($departments))echo 'checked';?>/>Finance Department </td></tr>  
             <tr><td><label for="select"><strong>Contact Agent:</strong></label></td>  
                    <td><select name="select">
                        <option value="Navigation">Navigation</option>
                           <option value="Online Agent" <?php if($select == 'Online Agent' && !empty($select))echo 'selected'; ?> >Online Agent</option>  
                           <option value="SEO, SMO Agent" <?php if($select == 'SEO, SMO Agent' && !empty($select))echo 'selected'; ?> >SEO, SMO Agent</option>  
                           <option value="SEM, SMM Agent" <?php if($select == 'SEM, SMM Agent' && !empty($select))echo 'selected'; ?> >SEM, SMM Agent</option>  
                           <option value="Development Agent" <?php if($select == 'Development Agent' && !empty($select))echo 'selected'; ?> >Development Agent</option>  
                           <option value="Consultancy Agent" <?php if($select == 'Consultancy Agent' && !empty($select))echo 'selected'; ?> >Consultancy Agent</option>  
                           <option value="HR Agent" <?php if($select == 'HR Agent' && !empty($select))echo 'selected'; ?> >HR Agent</option>  
                    </select></td></tr>  
                    <tr><td><label for="subject"><strong>Subject:</strong></label></td>  
                    <td><input type="text" name="subject" placeholder="Type Subject" style="width:250px;" value="<?php echo $subject;?>"/></td></tr>  
                    <tr><td valign="top" align="left"><label for="message"><strong>Your Message:</strong></label></td>  
                    <td><textarea cols="40" rows="10" name="message" placeholder="Write your message"><?php echo $message;?></textarea></td></td>  
                    <tr><td valign="top" align="right"><input type="submit" value="Send" name="submit" /></td>  
                    <td>Choose the color :<input type="color" name="color" value="<?php echo $color; ?>" />
                    <br />This Feature Works on Chrome.
                    <br />Developed by <a href="mailto:sam@qwc.me">Samee Ullah Feroz</a><br /> Powered by : <a href="http://www.qwc.me">QWC.Me</a></td></tr>  
               </form>  
               </table>
               </div>
             <div class="sidemsg" style="background-color:<?php echo $color?>; ">  
            <h2>Results Here</h2>
             <?php  
                   echo $name . "<br />";  
                   echo $number . "<br />";  
                   echo $email . "<br />";
       echo $website . "<br />";  
                   echo $gender . "<br />";
                   echo $birth . "<br />";  
                   if (!empty($departments))
                   {
                       echo implode("<br />", $departments) . "<br />";
                   }
                   echo $select . "<br />";  
                   echo $subject . "<br />";            
                   echo $message . "<br />";  
                   echo $error_msg . "<br />";
                   ?>  
             </div>
 </body>  
 </html>

Form is complete with full security and limitations.

Instructions : This code is in-complete if you need this form, contact Samee Ullah Feroz

Demo : 
Ask For Installation
Consultant: 
On Facebook
Gtalk : SEO.Getacho@gmail.com
Skype : SEO.Getacho


0 comments

Secure Form of $_GET[] Method : Form Validation Function

secure form

Now I am going to post a form with full security, Check this
I made this form to get full detail from client that how can we deal with him.
still this contact form is incomplete but I'll complete it in further post.
I made a stylesheet.css file
Here ; I made id for table to use it. As we know, id is used for unique element. 


 @charset "utf-8";  
 /* CSS Document */  
 #table_bg   
 {  
      border:5px;  
      border:solid;  
      background-color:#0F9;  
      border-collapse:separate;  
 }  



Now I made a contact.html file
This form output is same as given image in this post.
I used table to align form perfectly


 <!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>Contact Form</title>  
 <link rel="stylesheet" type="text/css" href="stylesheet.css" />  
 </head>  
      <body>  
           <table cellpadding="3" id="table_bg" align="center">  
           <form action="processing.php" method="get" >  
                <tr><td><label for="name"><strong>Full Name:</strong></label></td>  
                <td><input type="text" name="name" placeholder="Full Name" maxlength="20" style="width:250px;"/></td></tr>  
                <tr><td><label for="number"><strong>Personal Number:</strong></label></td>  
                <td><input type="text" name="number" placeholder="00923234223945" maxlength="16" style="width:250px;"/></td></tr>
                <tr><td><label for="email"><strong>Email:</strong></label></td>  
                <td><input type="text" name="email" placeholder="i.e. example@mail.com" style="width:250px;"/></td></tr>  
                <tr><td><label for="gender"><strong>Your Gender:</strong></label></td>  
                <td><input type="radio" name="gender" value="Male" />Male  
                <input type="radio" name="gender" value="Female"/ >Female</td></tr>  
                <tr><td><label for="department"><strong>Contact Department:</strong></label></td>  
                <td><input type="checkbox" name="department" value="Marketing_Department" />Marketing Department  
                <input type="checkbox" name="department" value="Development_Department" />Development Department</td></tr>  
       <tr><td><label for="select"><strong>Contact Person:</strong></label></td>  
                <td><select name="select" >  
       <option>Online Supporter</option>  
       <option>SEO, SMO Agent</option>  
       <option>SEM, SMM Agent</option>  
       <option>Development Agent</option>  
       <option>Consultancy Agent</option>  
       <option>HR Agent</option>  
       </select></td></tr>  
                <tr><td><label for="subject"><strong>Subject:</strong></label></td>  
                <td><input type="text" name="subject" placeholder="Type Subject" style="width:250px;"/></td></tr>  
                <tr><td valign="top" align="left"><label for="gender"><strong>Your Gender:</strong></label></td>  
                <td><textarea cols="50" rows="20" name="message" placeholder="Write your message"></textarea></td></td>  
                <tr><td>&nbsp;</td>  
                <td><input type="submit" value="Send" /> <input type="reset" value="Clear" /> </td></tr>  
           </form>  
           </table>  
      </body>  
 </html>  



Now I created a file processing.php
I needed to create this file for security. As we know, xHTML language runs on user side and PHP runs on Server side.
with $_GET[] Method, anyone can easily hack your code, that's why PHP is important to add creativity.
Features of Code:
  1. No value will be empty, User needs to enter all values
  2. If user will leave any value empty, form will redirect back to contact.html
  3. If user leaves spaces, form will trim them automatically
  4. HTML, Java code will not run in it.
  5. Back slash will not run in it
  6. User needs to write more than 25 characters in subject, more than 16 in message box, name maximum 20, number maximum 16



 <?php  
      require_once("form_validation.php");  
      #1st Form values should not be empty.   
      if (isset($_GET['name'] , $_GET['number'] , $_GET['email'], $_GET['gender'] , $_GET['department'], $_GET['select'], $_GET['subject'], $_GET['message'])  
      && $_GET['name']!="" && $_GET['number']!="" && $_GET['email']!="" && $_GET['subject']!="" && $_GET['message']!="")  
      {  
           if (strlen($_GET['name']) > 20 || strlen($_GET['number']) > 16 || strlen($_GET['email']) > 25 || strlen($_GET['subject']) < 25 || strlen($_GET['message']) < 160)  
                {  
                     header("Location: contact.html");  
                     exit;  
                }  
                $name = form_validation($_GET['name']);  
                $number = form_validation($_GET['number']);  
                $email = form_validation($_GET['email']);  
                $gender = $_GET['gender'];  
                $department = $_GET['department'];  
                $select = $_GET['select'];  
                $subject = form_validation($_GET['subject']);  
                $message = form_validation($_GET['message']);  
                echo "Name is : $name <br />  
                          Number is : $number <br />  
                               email is : $email <br />  
                                    Gender is : $gender <br />  
                                         Contact Department is : $department <br />  
                                              Subject is : $subject <br />  
                                                   Agent is : $select <br />  
                                                        Message is : $message <br />  
                ";  
           }  
           else  
           {  
                header("Location: contact.html");  
                exit;  
           }  
      ?>  

Now I created a function file with form_validation.php
In this function, it will use trim function to trim white spaces.
It will utilize HTML characters in whole form.
It will leave back slashes.


 <?php  
      function form_validation($input)  
      {  
           $input = trim($input);  
           $input = htmlspecialchars($input);  
           $input = stripcslashes($input);  
           return $input;  
      }  
 ?>  

Good Luck. Form is upgraded in further post.
5 comments

Download Input text bar Script And Try this code

Now you can download input text bar script and can use this code directly to any site easily. Try this code.
when you will give any value to input box, that value will be saved to an array and you can get array detail at header. and can get value from it.
use it.
here $inputs is variable of array.
Note : Download Input Text Bar code and  use it to your site directly.


 <?php  
   $inputs = array();  
   if (isset($_POST['submit'])) { //to check if the form was submitted  
     $value = isset($_POST['input0'])? $_POST['input0'] : null;  
     for($count = 1; $value != null; $count++){  
       array_push($inputs, $value);  
       $value = isset($_POST['input'.$count])? $_POST['input'.$count] : null;  
     }  
   }  
   var_dump($inputs);  
   // to access specific index  
   // to take more then 3 inputs just add one more input field in form  
   //echo $inputs[0];  
   /*  
    *  
    *  
    *code here  
    *  
    *  
    *  
    */  
 ?>  
 <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">  
   <!-- to take multiple inputs copy the below line and change name="input" attribute -->  
   Enter input 1:&nbsp;<input type="text" name="input0" value="" /><br />  
   Enter input 2:&nbsp;<input type="text" name="input1" value="" /><br />  
   Enter input 3:&nbsp;<input type="text" name="input2" value="" /><br />  
   <input type="submit" name="submit" value="Submit" />  
 </form>  
0 comments
 
Support : | Internet Marketing Specialist And Business Developer
Copyright © 2013-2016. Samee Articles - All Rights Reserved
Proudly powered by Blogger