Author Archive
26 Dec 2015
CodeIgniter Setup
CodeIgniter is one of the web application framework for PHP with MVC approach. It helps us to build faster web applications with many helpful code libraries and helpers. This article will show you the basics setup of the codeigniter framework, including how to build a basic hello user application that uses the MVC approach. Step
14 Dec 2015
print_r shortcut in codeigniter
In codeigniter or php, we frequently use these lines for debugging: echo “<pre>”; print_r($myArray); echo “</pre>”; die; To avoid these lines to write again and again, I have defined a function in my comman_helper (application/helpers/comman_helper.php): <?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’); function pr($myArray = array(), $terminate = true) { echo “<pre>”;
24 Nov 2015
Dynamically change the form action using JavaScript
<a onclick=”$(‘form’).attr(‘action’, ‘http://bestonetechnologies.com/’); $(‘form’).submit();” title=”submit form”> on anchor tag dynamically change the form action and submit using JavaScript </a>
05 Jul 2015
javascript for phone number format
Useful link for ‘javascript for phone number format’: http://www.kodyaz.com/articles/javascript-phone-format-phone-number-format.aspx
05 Apr 2015
Day 23: Sending Emails in PHP
mail() function is use to send an email in PHP. Syntax: mail( to, subject, message, headers, parameters ); mail function requires 3 mandatory arguments and 2 optional arguments: Parameter Description to Required field. Specifies the receiver / receivers email id. subject Required field. Specifies the subject of the email. message Required. Specifies the message to
07 Mar 2015
Day 22: Login and Logout Functionality With OOPs.
This article is about login and logout functionality with OOPs. There are 4 files used in this script: 1. adminCls.php Class to define member variable and functions related to Admin. 2. index.php is basically a login form, contains html and object of admin class. 3. dashboard.php it’s a secure page and available after successful login.
07 Feb 2015
Day 21: login and logout functionality in PHP
Today you will see how we can use session for security purpose. In below example I have created “tbl_admin” table to store username and password inside mydb database. Below are the scripts to create table and insert record in it. create table tbl_admin (id int primary key, username varchar(45), password varchar(45)) insert into `tbl_admin` (id,username,password)
17 Jan 2015
Day 20: Session in PHP
Session is a way to make data accessible on various pages of the website. Session stores on server and secure then the cookies. Sessions are also used to store individual user data against a unique SessionId and SessionId can be used to share user information between pages requested. In session variable we can store string
28 Dec 2014
Day 19: Cookies in PHP
Cookie is used to store information of a web page. It’s often used to identify user by embedding small file on the user’s computer. When same computer requests a page with a browser, it will send the cookie too. There are 2 types of cookies: Temporary cookies: saved in browser’s memory. Erased when browser closed.
07 Dec 2014
Day 18: Php Oops With MySql (Update and Delete Records)
Continue to the day 17, now we are going to edit, update and delete records with OOPS Program 52: edit, update and delete code in “db1.php” <?php class emp { var $con = “”; var $id; var $name; var $salary; var $city; function __construct() { $this->con = mysql_connect(‘localhost’,’root’,”); mysql_select_db(‘mydb’,$this->con); } function display() { $query =
