Archive: how-to
-
Feb 22, 2012
Comments Offhow to do table partition in mysql
HI all of my php programmer. Mostly MYSQL DBA done the partitioning but if we talk about programmer then they are unable to do. so don’t worry friends here is the solutions for mysql partitioning in easy steps. First run this query to you panel and check patition is on or not. mysql> SHOW VARIABLES...
-
Sep 09, 2011
Comments OffTesters Vs Programmers In Company.
When Programmer Think about tester they always feel anger. When Tester Think about programmer they Smile. Do you know why because due to tester programmer always feel embarrassed because tester find some mistakes in his program. How the tester do in software. There is lots of testing types through which tester test the software or...
-
Sep 02, 2011
Comments OffHow to optimize mysql query and mysql database?
There is lots of way to optimize mysql. once you optimize your query and database of mysql it will make your website and application very fast. Firstly choose which table being used every time for delete, insert or update make a list and always repair these tables. after 15 days. this is very good question...
-
Sep 02, 2011
Comments OffHow to optimize php code.
In this post we are going to learn how to optimize our php code. once you optimize your php code then your applicationa and website will be very fast this will make quality code. Hi php programmer don’t forget these rules if you want to be good in php and want to work in MNC...
-
Sep 02, 2011
Comments OffProgrammer VS Company : How any programmer will feel secure in Company?
Programmer VS Company All of friends I am going to share my Experience about the company and Programmer ,what I feel in last 7 Years and I work at 13 places (What was my position there Trainer, Programmer, Sr. Programmer and finally Team Lead) at some places I do the job on Saturday and Sunday....
-
Aug 29, 2011
Comments OffCanada’s postal code validation in PHP
Few days back, My friend Narendra asked me how to validate the postal code of Canada which is entered through the text box.And, I came up with this Php function as solution for him. These are the conditions for validation of the postal code of Canada. There are six alphanumeric letters. Alphabate and digits...
-
Aug 29, 2011
Comments OffUSA’s Zip Code Validation in PHP
My friend Sushil was trying to write the regular expression for validating the format of the zip code of USA. After spending few minutes, I came to this solution. The valid format of zip code of USA might be a five digit number like “12345” or in the format of 4 digit followed by...
-
Aug 29, 2011
Comments OffTextbox to accept only numbers (digits) using jquery
Few days back, my friend Parleen asked me how can we make a textbox which just accepts only numbers specially digits only. And, for his I come up with this solution of textbox which only accepts digits, and if you try to enter any alpha bates in it then it displays the error message with...
-
Aug 29, 2011
Comments OffIp address validation in PHP using regular expression
If you don’t know how to validate the IP address format in PHP, then you are in the right place.I’ll show you here how to validate the IP address using regular expression in PHP. As you guyz know, IP address consists four parts. Each parts separated by period “.” and these part consists the...
-
Aug 29, 2011
Comments OffHow to do Date format validation in PHP
Today Sushil asked me how can we validate the date which is entered from textbox in “YYYY-MM-DD” format. Well, we can validate the format of the date using regular expression but how to validate weather that date is valid date or not, such as “2007-02-29″ is the correct format of the date but it’s not...
-
Aug 29, 2011
Comments OffUnderstanding and Validating Integers in PHP
I’ve found many of my friends struggling with the validation of integers i.e. the numbers with only digits in PHP. Some of them were wondering why is_int() or is_integer() functions of PHP sometimes works and sometimes won’t. If you become clear with the concept of integer and string in PHP then you’ll obviously come...
-
Aug 29, 2011
Comments OffHow to disable the Enter key on HTML form
Normally when you have a form with several text input fields, it is undesirable that the form gets submitted when the user hits ENTER in a field. Some people are pressing the enter key instead of the tab key to get to the next field. They often do that by accident or because they are...
-
Aug 29, 2011
Comments OffHow to install and configure PHP 5 on Windows box
It is assumed that you have already successfully setup IIS or installed Apache on your machine and configured it. So, to configure PHP and secure its correct operation you need to go through a couple of steps. Download and unzip the latest version of PHP Rename/copy php.ini-recommended to php.ini Create a session state directory and...
-
Aug 29, 2011
Comments OffHow to Send Email (Text/HTML/Attachments) in php
Email is the most popular Internet service today. A plenty of emails are sent and delivered each day. The goal of this tutorial is to demonstrate how to generate and send emails in PHP. So, you want to send automated email messages from your PHP application. This can be in direct response to a user’s...
-
Aug 29, 2011
Comments Offhow to work with Directories in php
As is necessary for any language, PHP has a complete set of directory support functions. PHP gives you a variety of functions to read and manipulate directories and directory entries. Like other file-related parts of PHP, the functions are similar to the C functions that accomplish the same tasks, with some simplifications. This tutorial describes...
-
Aug 29, 2011
Comments OffHow to connect to MS SQL Server database
Below is the code for connecting to a MSSQL Server database. <?php $myServer = “localhost”; $myUser = “your_name”; $myPass = “your_password”; $myDB = “examples”; //connection to the database $dbhandle = mssql_connect($myServer, $myUser, $myPass) or die(“Couldn’t connect to SQL Server on $myServer”); //select a database to work with $selected = mssql_select_db($myDB, $dbhandle) or die(“Couldn’t open database...
-
Aug 29, 2011
Comments OffHow to make DSN and DSN-less connections
DSN stands for ‘Data Source Name’. It is an easy way to assign useful and easily rememberable names to data sources which may not be limited to databases alone. If you do not know how to set up a system DSN read our tutorial How to set up a system DSN. For our example below...
-
Aug 29, 2011
Comments OffBlocking access to the login page after three unsuccessful login attempts
Sometimes you need to add an extra protection to password-protected website. This article explains how access to the login page can be restricted after three unsuccessful login attempts. This schema uses visitors IP address to store log attempts in the database and block access to login feature for 30 minutes after third unsuccessful attempt. There...
-
Aug 29, 2011
Comments OffHow to Create CAPTCHA Protection using PHP and AJAX
Download Source CAPTCHA is a simple test to determine if a user is a computer or a human. It is used to prevent spam abuse on the websites. So if you use CAPTCHA on your web site forms, this can help in stopping some bots and making life harder for other bots in accessing or using your...
-
Aug 29, 2011
Comments OffHow to Pass JavaScript variables to PHP
JavaScript is mainly used as a client side scripting language, while PHP is a server side technology. Unlike Java or ASP.Net, PHP doesn’t have tools to make it work client side. That is why you need to combine JavaScript and PHP scripts to develop powerful web-applications. One of the frequent problems is defining visitor’s screen...