Saturday, 30 November 2013

PHP registration form validation code with MySQL database connectivity

registration form in php and mysql with validation

Here i am providing  you the single php code required to create a simple signup/registration form with all the necessary validations and connectivity with mysql database so that the user input data can be stored in the database.


The form will look like this :

Just follow these steps at time of using the code:

  • In the database connectivity portion of the code change the phpmyadmin username and password to that of yours.
  • Create the database "user_signup" and table "user" in phpmyadmin (code is provided for that as comment ).
  • In the "user_signup" database, Just run the  "create table..." query provided in run sql query section in phpmyadmin to create the table "user" .
  • Now save the code as "form1.php"  in the wamp/xampp root directory from where you will run the code in the browser.
  • when user fills up the form and press submit ,the data will be inserted in the database and user redirects to the same signup form.( change the header location in the code if you wish to direct user to some other page).

 The code is as follows :

 //form validation  
 // define variables and set to empty values  
 $fname = $lname = $email = $address = $gender = @$memtype = "";  
 @$uname = @$passn = "";  
  $fname = test_input($_POST["fname"]);  
  $lname = test_input($_POST["lname"]);  
  $email = test_input($_POST["email"]);  
  @$address = test_input($_POST["add"]);  
  @$gender = test_input($_POST["gen"]);  
  @$uname = test_input($_POST["username"]);  
  @$passn = test_input($_POST["pass"]);  
  @$memtype = test_input($_POST["mtype"]);  
 function test_input($data)  
  $data = trim($data);  
  $data = stripslashes($data);  
  $data = htmlspecialchars($data);  
  return $data;  
 // define variables and initialize with empty values  
 $fnameErr = $lnameErr = $emailErr = $addressErr= $ageErr= $unameErr = $passnErr= $genderErr = $memtypeErr = "";  
 $fname1 = $age1 = $lname1 = $email1 = $address1 = $gender1 = $passn1 = $uname1 = $memtype1 = "";  
 if ($_SERVER["REQUEST_METHOD"] == "POST") {  
  $valid = true;  
      if(empty($_POST["fname"])) {  
     $fnameErr = "Missing Firstname";  
     $valid =false;  
   else {  
     $fname1 = test_input($_POST["fname"]);  
           // check if name only contains letters and whitespace  
   if (!preg_match("/^[a-zA-Z ]*$/",$fname))  
    $fnameErr = "Only letters and white space allowed";  
      if (empty($_POST["lname"])) {  
     $lnameErr = "Missing Lastname";  
   else {  
     $lname1 = test_input($_POST["lname"]);  
     // check if name only contains letters and whitespace  
   if (!preg_match("/^[a-zA-Z ]*$/",$lname))  
    $lnameErr = "Only letters and white space allowed";  
      if (empty($_POST["email"])) {  
     $emailErr = "Missing email address";  
   else {  
     $email1 = test_input($_POST["email"]);  
           // check if e-mail address syntax is valid  
   if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email))  
    $emailErr = "Invalid email format";  
   if (empty($_POST["add"])) {  
     $addressErr = "specify Address ";  
   else {  
     $address1 = test_input($_POST["add"]);  
   if (!isset($_POST["gen"])) {  
     $genderErr = "specify your gender";  
   else {  
     $gender1 = test_input($_POST["gen"]);  
      if (!isset($_POST["mtype"])) {  
     $memtypeErr = "specify your membership type";  
   else {  
     $memtype1 = test_input($_POST["mtype"]);  
      if (empty($_POST["age"])) {  
   else {  
     $age = test_input($_POST["age"]);  
      if (preg_match("/^[a-zA-Z ]*$/",$age))  
    $ageErr = "Invalid age";  
      if (empty($_POST["username"])) {  
     $unameErr = "specify your username";  
   else {  
     $uname1 = test_input($_POST["username"]);  
      if (empty($_POST["pass"])) {  
     $passnErr = "specify your password";  
   else {  
     $passn1 = test_input($_POST["pass"]);  
 // here form validation ends        
 -- Database: `user_signup`  
 -- --------------------------------------------------------  
 -- Table structure for table `user`  
  `FirstName` char(30) NOT NULL,  
  `LastName` char(30) NOT NULL,  
  `Email` char(30) DEFAULT NULL,  
  `CPhone` mediumtext,  
  `Address` varchar(70) DEFAULT NULL,  
  `Age` int(11) DEFAULT NULL,  
  `Gender` char(10) DEFAULT NULL,  
  `UserName` varchar(20) NOT NULL,  
  `Password` varchar(20) NOT NULL,  
  `MType` char(10) NOT NULL,  
 //mysql database connectivity  
 //inserting form data into the database  
 $con= mysql_connect("localhost","username","password");  //change the username and password  
 mysql_select_db("user_signup", $con);  
 mysql_query("insert into user (FirstName,LastName,Email,CPhone,Address,Age,Gender,Username,Password,MType) values('$a','$b','$c','$d','$e','$f','$g','$i','$j','$h')");  
 border:7px solid red;  
 <body >  
 <div class="ex">  
 <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post" >  
 <table id="rtid1" border="0" cellpadding="5" cellspacing="0" width="600">  
 <tr id="rtrid1">  
 <input id="FirstName" name="fname" value="<?php echo htmlspecialchars($fname);?>" type="text" maxlength="60" style="width:146px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$fnameErr;?></i></font></span>  
 <input id="LastName" name="lname" value="<?php echo htmlspecialchars($lname);?>" type="text" maxlength="60" style="width:146px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$lnameErr;?></i></font></span>  
 <b>Email address*:</b>  
 <input id="FromEmailAddress" name="email" type="text" value="<?php echo htmlspecialchars($email);?>" maxlength="60" style="width:200px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$emailErr;?></i></font></span>  
 <tr id="rtrid2">  
 <td><b>Cell Phone:</b></td>  
 <td><input id="CellPhone" name="cell" type="text" maxlength="43" style="width:200px; border:1px solid #999999" /></td>  
 <tr id="rtrid3">  
 <td><b>Address *:</b></td>  
 <td><input id="StreetAddress1" name="add" type="textarea" value="<?php echo htmlspecialchars($address);?>" maxlength="120" style="width:300px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$addressErr;?></i></font></span>  
 <tr id="rtrid4">  
 <input id="Age" name="age" type="text" maxlength="120" style="width:300px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$ageErr;?></i></font></span>  
 <tr id="rtrid5">  
 <input type="radio" name="gen" <?php if (isset($gender) && $gender=="male") echo "checked";?> value="male" id= "rgm">Male  
 <input type="radio" name="gen" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female" id="rgf">Female  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$genderErr;?></i></font></span>  
 <tr >  
 <input id="Username" name="username" type="text" value="<?php echo htmlspecialchars($uname);?>" maxlength="60" style="width:146px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$unameErr;?></i></font></span>  
 <input id="Password" name="pass" type="password" value="<?php echo htmlspecialchars($passn);?>" maxlength="60" style="width:146px; border:1px solid #999999" />  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$passnErr;?></i></font></span>  
 <tr id="rtrid6">  
 <td><b>Membership type*:</b></td>  
 <input type="radio" name="mtype" <?php if (isset($memtype) && $memtype=="ordinary") echo "checked";?> value="ordinary">Ordinary     
 <input type="radio" name="mtype" <?php if (isset($memtype) && $memtype=="premium") echo "checked";?> value="premium">Premium  
 <span class="error"><font color="red"><i><?php echo "&nbsp&nbsp&nbsp".$memtypeErr;?></i></font></span>  
 <td colspan="2" align="center">  
 <br />  
 <br><input id="skip_Submit" name="skip_Submit" type="submit" value="Submit" /></br>  

Saturday, 9 November 2013

Bitdefender total security 2013 free Download with lifetime activation

bitdefender total security 2013 full version download

Bit defender total security 2013 comes up with all the features required for PC protection and is one of the best anti-virus in the market today.Not only does it protect your computer and files, but it is easy to use and since here's the free download link available just at the bottom so value doesn't matter.

Standout Features

* Effective antivirus protection

* Light footprint on your computer

Steps to Follow

  • After downloading, Open the folder named "~Get Your Software Here"

  • Then see the video "Bit Defender 2013 Lifetime Activation Video Tutorial - code3h.mp4" which will guide about the installation procedure.
  • Just follow the steps of the video to get the fully licensed version of bit defender for lifetime .

Here's the download Link

Sunday, 29 September 2013

learn php step by step through videos !!!!


Download free videos to learn php in few Hours!!!

What is php??


The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases.It is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages and for developing web based software applications. . PHP is a server-side, cross-platform, HTML embedded scripting language.

PHP statements and commands are actually embedded in HTML documents having content of a webpage.When a webpage runs on a browser the php commands gives it output,displayed on the webpage which cannot be seen in the source code.

Here is the link from which you can download video tutorials - PHP fundamentals by Jeffrey way( editor of Nettuts+) which are very useful in understanding the basic concepts of php and its fundamentals.The videos are very easy to understand and describes all platforms required to run php etc.

Here's the download link

Sunday, 22 September 2013

How to find email addresses from your own gmail Account?

How to find email addresses from your own gmail Account?

Finding valid email addresses on internet without much knowledge about a person is a tough task .You must have seen your mailing account got filled with  plenty of random emails send from people you never met and try to reply them , no response generally comes back.

These emails are generally sent by educational companies ,shopping websites etc for business purposes and advertisements.And at some point of time , somehow you entered your email address in a website to complete a survey and now they can send you as many emails they want till you unsubscribe.

From my long "re"search on the internet about email addresses, I found out that there are bulk of websites,softwares etc available to get random email addresses like Rapportive(its good),email permutator,Email address collector  etc.Certain websites directly offers you large no of addresses by make you complete some surveys but God know if they are valid or not!!!

Even though, it didn't worked for me , i tried many softwares and websites to get a genuine list of email addresses for some business purpose but most of them were wrong.I mailed them and suddenly a reply came to me saying:

 Delivery to the following recipient failed permanently:


Technical details of permanent failure:
The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces.......................!!!

The tutorial will show you get a valid list of email addresses from your own gmail account without any software,website,blog etc.

1. Login to your gmail account

2. Now type "Fwd" in the search section of your account
   and press "enter".

Now you will get a list of all "forwarded"emails you received that is they are send to you by another person who received it from some other one.  

3. Now select one of the mail and see inside.
you may get a no of other recipients email addresses to whom the mail is sent or forwarded and the person's other mail addresses whom sent mail to you.
This is a zero time consuming and good practice to find out quick contacts and their mail info.

Thank you!!!

Wednesday, 14 August 2013

some most sought after open source big data tools!!

Big data is the term for a collection of data sets so large and complex that it becomes difficult to process using on-hand database management tools or traditional data processing applications.


The data is too big, moves too fast, or doesn’t fit the structures of your database architectures. To gain value from this data, you must choose an alternative way to process it.The challenges include capture, storage, search, sharing, transfer, analysis and visualization.So a need arises to know how Big data works? There are some open source tools , you can try your hands with.

Friday, 9 August 2013

Some expensive quality gadgets , that add luxury to your home!!


Some of the high-tech expensive Gadgets of 2012-2013.Lets take a look at some of these.......

Loewe 55" Individual

cost :  $8,499.00/Rs. 5,46,750



This entertainment system opens up many multimedia possibilities.With its surround sound and High quality 3D environment will make your home your theater. you can watch web videos,listen to online radio and can even convert your 2-D programmes to 3-D.With a 400 Hz E-led  backlit screen, an integrated 3D blue-ray player and a hard disk recorder with 500 GB memory ,everything you need comes from one source.Know more about the Gadget 

Tuesday, 6 August 2013

How to test a website on Different mobile devices?

What testing does your mobile Site need?

Be prepared to test your website on as many mobile devices as you possibly can. Although you can use your browser to test or imitate thing such as screen size, display, layout etc. but there are some horrible things that can go wrong which cannot be seen on a browser. Some of these are:

Monday, 5 August 2013

Easiest and Fastest way to sync and share your files !

Free online Syncing tool to sync all your files at one place!!!


Most of us use multiple devices to store and access our files. At home, Laptop is used, desktop, tablets at work and Smartphone on the go. Storing files on cloud rather than on a personal device makes data's access more convenient and easy. There are many online storage platforms which lets you to sync all your data and files. The latest cloud storage device in the queue is 4sync. If you are using one or planning to use, then give a try to 4sync. It lets you access all your files and data from anywhere at any time. It gives 15 GB of free online data storage space.Though Google drive and dropbox are available but 4sync is a good alternative.
A look at some of its features

Saturday, 3 August 2013

What makes Google glass, the most hotly anticipated Gadget!!!!

What makes Google glass, the most hotly anticipated Gadget!!!!

Wearable smart-devices represent the next phase in mobile computing. It is not an extension of your Android Smartphone or tablet, but is a whole new gadget in itself that can perform various day to day tasks, without you ever moving your hands. Google glass is a high tech and advanced Eye glasses that are powered by android OS. It can connect to internet and record videos plus it can take pictures just like your Iphone but the best thing is that you only need wear it like sunglasses. This glass control via voice commands just like "Ok” represent Enter button on a pc. In addition this glass got GPS (global positioned system) that can help user to find where they need to go. Google glass uses Wi-Fi as band.


Some cool features of Google glass one must know…..

Thursday, 1 August 2013

A look at the world’s slimmest Full HD smartphone !!

Xperia Z Ultra

Sony recently launched its Xperia Z Ultra in India claiming to be the slimmest full hd smartphone. It is one of the biggest handsets in the world. The new device, which has a 6.4-inch screen, has been priced at Rs 46,990 and will hit the stores on August 2. It is water and dust resistant and run on Android 4.2(Jelly bean).The device has the same design language as Xperia Z smartphone and features on-screen keys as well as scratch-resistant and shatterproof glass.What makes Windows 8.1 different from others?

Key features:

Tuesday, 30 July 2013

Capture and print anything from a Webpage within seconds !!

Print any webpage or anything from it within seconds!!!

For Mozilla Firefox users, there’s an add-on to make life easier and less complicated .If you have a printer attached to your device then you must use it to print out important pictures, documents etc .Then what’s the process to do that, Going to the print option, selecting various options, which page to print then giving the print command. What if you want only an image’s printout from a webpage? The procedure will be...First saving the image then taking it further to print. I think it’s much complex and pointlessly occupies your device’s space. If you commonly use printer then check out how many useless pictures and documents are lying here and there on your device. They must be in huge numbers.What makes Smartphone a "smart phone"!

There are more than a few Add-Ons which enable you to capture a webpage's area; however its primary objective is to save the captured area as an image on your hard-disk. This add-on let's you forward the captured area directly to your printer, thus saving time if what you want is to print captured areas since no need to load and then print the saved image on disk.

Saturday, 27 July 2013

8 must have open source apps for windows!!

8 must have open source apps for windows!!

Open source softwares are available for windows. The benefits of using them are many: apart from helping you to get your work done in an efficient manner, open source products can also save your additional expenses because they are either free or comparatively cheaper than their privately owned counterparts. Here are eight open source softwares/tools that a windows machine must have:

Wednesday, 24 July 2013

How to keep your conatcts up to Date always?

When you work in a team, especially a bigger one, it’s quite a hassle to keep everyone’s contact up to date. Working in a team requires building a good relationship with everyone and you shall want to remain in touch with everyone who works with you. So a need arises for a good contact management app .Check out contactzilla,

Friday, 19 July 2013

How to sign in to multiple Gmail accounts at same time ?

I always used to feel tired of signing out to switch between my accounts on my computer, since I have more than one email addresses on Gmail. Many of us have gmail multiple accounts for work, personal life and volunteering. As more organizations move to Google Apps, a growing number of users end up with multiple Gmail accounts. And what if, you want to access two accounts at the same time. So a need arises to show up how to login to 2 Gmail accounts at the same time in Chrome, Firefox and Internet Explorer.8 must have open source apps for windows!!

 Now whenever you need to switch accounts, just click the Add account button to sign in to your other account(s) and conveniently switch between multiple gmail inboxes.The later tutorial will show you, how to do it.

Thursday, 18 July 2013

How to Preserve the look of original text format, When Using Copy and Paste?

E-mail, in general, involves only plain (ASCII) text, while Word documents can contain lots of formatting. There is no way to entirely preserve the formatting of a Word document when copied into the body of an e-mail. There are several options, however, depending on your goals. 



Steps to follow:

Tuesday, 16 July 2013

How to keep pc protected and virus free (offline/online)?

Every user wants to stay safer online and offline. As there are large no of viruses/malware/Trojan roam around on the internet, Apart from using best Antivirus, you can follow these six essential steps to protect your devices, information, and family on the Internet.

Every piece of software is going to have some kind of exploit, but there are several things you can do in order to keep yourself and your device safe no matter what PC or operating system you use.

1. Be careful what type of sites you visit. There are many dishonest websites out there that will readily infect your machine with a virus or adware. 

2. Instead of downloading music, go to the store and buy the CD. Not only will you avoid any financially difficult legal situation, you'll also avoid any website that promises free MP3 downloads but only delivers viruses and adware. 

Sunday, 14 July 2013

How to Generate your own QR-code for free !!!!

How to generate your own Qr-code without spending a single penny

The QR code is a 2D code, pretty similar to a barcode, but two-dimensional. The picture of the qr code looks kinda of like a labyrinth. The great thing about the QR Code or Quick Response Code is that a barcode scanner(qr code reader)  can read the code off of screen images and printed images.

Are you an Advertiser, ad publisher or a marketer.Want to Grow your business.Then start using qr-code codes for your product,websites, contacts etc.Everyone know what are qr-codes but many don't know how useful they are.So let's first know ,why to use them.....

Saturday, 13 July 2013

The new Nokia Lumia 1020 specifiications revealed!!!!

Specs of the new nokia lumia 1020

Nokia lumia 1020 comes up 4.5 inch AMOLED WXGA (1280 x 768) 2.5D sculpted glass Gorilla Glass 3  display, dual-core  processor, 41 MP camera.The Smartphone's release date in India is not yet known.

So far Nokia has announced only a specific release date for the US. The Lumia 1020 will launch on the AT&T on 26 July.What makes Windows 8.1 different from others? It has said that other markets will get the smartphone 'this quarter' which means by the end of September.Let's wait for the launch and today we are going to unleash all the smart phone features  in detail.

What makes Smartphone a "smart phone"!

Seeing other’s Smartphone you must think that what are the special features of the phone? But many don’t know that there are some apps which make a Smart phone special and smart. Let’s talk about these apps……

Thursday, 11 July 2013

Perform ECG test with a Cell Phone

Things are become much simpler with  advancement in technology and to make life easier and less complicated, An IIT professor and his student has come with a combination of Smartphone application and device which can record user’s heartbeat and pulse rate, do ECG and tell if one needs to consult the doctor or not.

Dropbox expands its limits !!!!

In a bid to become omnipresent, Dropbox unveils tools to help developers sync apps across mobile platforms. Developers can now sync structured data which was not normally accessible for file synchronization.

Drop box, the fast-growing file-synching and file-sharing service, today announced new tools that could help the company become a crucial assistant to developers in an increasingly uneven mobile ecosystem.

Wednesday, 10 July 2013

Apple iphone,ipads apps for free

Apps made for iPad are apps like no other. They’re big, beautiful, full-screen apps that make the most of all the amazing technology inside iPad. And you’ll find apps in just about every category imaginable. Download apps for work, school or just plain fun. There are more than 300,000 apps to choose from, there’s no telling where the next hit will take you.

Tuesday, 9 July 2013

Don’t charge your Mobile battery to the FULL !!!

 Many people charge their mobile’s battery everybody or some charges it when goes empty. Ways of charging battery are so many but everybody wants that their phone’s battery life goes for long. According to the Experts one should never charge the mobile battery to 100%. If you want to extend the life of your mobile phone’s battery, then try to avoid charging it to 100 percent.
Technology website  has claimed that mobile phones should not be charged to 100 percent as it shortens the battery life.

Sunday, 7 July 2013

11 Google features, of which World is unaware of !

Google is mostly popular for its search engine(google search) and Mobile operating system –Android. The First use of Google which comes to our mind is through Search engine as people use it to solve their most difficult to most basic problem.There are many reasons for why people prefer Google over other search engines like Google is a faster and lighter web engine.It provides many important facilities such as DART programming language, jobs, games, and many more.
Believe me or not, if you have a slow internet network, try browsing Google and many other famous websites. You'll see that Google takes less time to load completely. Also,
It is a much more "modernized" search engine, it doesn’t just search key words, and it searches spelling, phrases and para-meanings. Using Google is incredibly easy because it doesn’t just read what you say; it picks up what you meant. How to keep pc protected and virus free (offline/online)?

But Its Network is far more than of search engine and Smartphones.

Friday, 5 July 2013

Computer mouse inventor "Doug Engelbart " may Rest in Peace

Computer mouse inventor Doug  Engelbart  “ is no more between us. He was born on 30 January 1925 inPortland, Oregon, to a radio repairman father and a housewife mother.The  88  year old developed the tool in the 1960s as a wooden shell covering two metal wheels, patenting it long before the mouse's widespread use . He also worked on early incarnations of email, word processing and video teleconferences at a California research institute.The American engineer and inventor, and an early computer and Internet pioneer died peacefully on  Tuesday night on his bed while sleeping.

Wednesday, 3 July 2013

Qwiki's new owner is yahooooo!!!

Brief intro to qwiki 

Don’t know, what's qwiki ?It is a mobile company that uses awesome technology to bring together pictures, music and video to capture the art of storytelling.  It is a New York City based start up automated video production company. Most recently, Qwiki released an iPhone app that automatically turns the pictures and videos from a user’s camera roll into movies to share.

So, if you have captured some beautiful pictures , have some short clips etc then you can easily convert them in videos, movies  to share .In auto mode, the app quickly makes a search of  the iPhone’s camera roll, determines that certain photos or videos are related, and creates a slideshow-like mixture of those images, incorporating music from the person’s library. Certain elements, such as the song selection, filters or captions, can be changed afterwards. Individual pictures and video clips can also be rearranged, added or removed.

Qwiki differs from mobile video apps like Twitter’s Vine or Facebook’s Instagram video because it uses content already on people’s phones. Vine and Instagram are for recording and sharing new clips. Qwiki movies can be shared via Facebook, Twitter, email and SMS, or embedded in blogs and Web pages. The app is currently available only in Apple’s App Store; there is no version for Android devices

Now, I should come to the main topic- Yahoo acquires qwiki, , as part of its push into the mobile market.

Tuesday, 2 July 2013

What makes Windows 8.1 different from others?

As everybody is excited about Windows 8.1,  Microsoft CEO Steve Ballmer  took  the stage in San Francisco to talk about about the keynote address at the annual BUILD developers conference where he outlined the company's future strategy and revealed a number of impressive updates to the Windows 8 operating system.Don’t charge your Mobile battery to the FULL !!!

Although Windows 8.1 won't officially launch until the end of 2013. But,For those using windows 8  this post can be really interesting as I will talk about the latest  changes in windows 8 and windows 8.1 features:

Turingo: Answer Your Curiosity

Create questions | Search questions | Get your answers | Join Communities | Create your teams | Get answers to your curiosity