Posts

Showing posts from October, 2013

jquerymobile login form with php

jquerymobile login form with php login.php  <!DOCTYPE HTML> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"> </script> <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"> </script> </head> <body> <script language="JavaScript" type="text/JavaScript"> function logout() { $.get('logout.php', function() { alert("the server page executed"); //Here you may do further things. window.location = window.location; }); } </script> <?php if($_POST['username'] =='a

Learn Object Oriented Programming (OOP) in PHP5.3

Object Oriented Concepts in php: Before we go in detail, lets define important terms related to Object Oriented Programming. Class: This is a programmer-defined datatype, which includes local functions as well as local data. You can think of a class as a template for making many instances of the same kind (or class) of object. Object: An individual instance of the data structure defined by a class. You define a class once and then make many objects that belong to it. Objects are also known as instance. Member Variable: These are the variables defined inside a class. This data will be invisible to the outside of the class and can be accessed via member functions. These variables are called attribute of the object once an object is created. Member function: These are the function defined inside a class and are used to access object data. Inheritance: When a class is defined by inheriting existing function of a parent class then it is called inheritance. Here child class will inheri

Optimizing MySQL: Queries and Indexes

Optimizing MySQL: Queries and Indexes   You know the scene. The database is just too slow. Queries are queuing up, backlogs growing, users being refused connection. Management is ready to spend millions on "upgrading" to some other system, when the problem is really that MySQL is simply not being used properly. Badly defined or non-existent MySQL indexes are one of the primary reasons for poor performance, and fixing these can often lead to phenomenal improvements. Consider an extreme example: CREATE TABLE employee (    employee_number char(10) NOT NULL,    firstname varchar(40),    surname varchar(40),    address text,    tel_no varchar(25),    salary int(11),    overtime_rate int(10) NOT NULL ); To find employee Fred Jone's salary(employee number 101832), you run: SELECT salary FROM employee WHERE employee_number = '101832'; MySQL has no clue where to find this record. It doesn't even know that if it does find one matching, that there will not be