Problem:How to upload file in CodeIgniter?
You can simply use $_FILES array to upload image. But if you want to use CodeIgniter library to upload file, then how can you achieve this?
Solution:You can use $this->load->helper('form'); to generate form.
After that configure using $config[], set this $config[] same as $this->load->library('upload',...
Sunday, March 29, 2015
Prevent XSS in CodeIgniter
Problem:
How to prevent XSS Cross Site Scripting in CodeIgniter
Solution:
use $this->security->xss_clean($input_data); method
OR
set $config['global_xss_filtering']=TRUE;
Example:
$input_data = $this->security->xss_clean($input_data);or add this line in config.php file$config['global_xss_filtering'] = TRU...
Binding Where IN Clause in CodeIgniter
Problem:
How to bind multiple and single value in where IN sql clause using CodeIgniter
Solution:
Pass array variable in query
Example:
Passing single numeric value using array.
$sql = "SELECT * FROM tbl_name WHERE id IN ? AND nm = ? AND code = ?";$this->db->query($sql, array(array(1), 'nm123', 'c123'));
Passing multiple numeric value...
Saturday, March 28, 2015
load model in view codeigniter
Problem:
How to load model in CodeIgniter view? It is not a good idea to load model in view, but sometime it is a requirement to load model in view.
Solution:
Create the instance of CodeIgniter as below:
$ci_inst =&get_instance();
Then load your model as below:
$ci_inst->load->model('model_name');
now you can access model as below:
$rs_truck=$ci_inst->model_name->function_method_name(parameter);
Example:
$ci_inst...
Wednesday, March 25, 2015
Email Blaster
AmitMarch 25, 2015.Net, ajax, c#, CodeIgniter, java, javascript, jquery, Ms Access, ms sql server, mysql, oracle, PHP, Servlet, Software, sql, sql query, VB.net
No comments

Email Blaster
*Features
- Send unlimited emails.
- Send test email, so you can see your email format and looks.
- Show real time progress in counting sent emails.
- Show progress in percentage(%)
- Send email both format Text and HTML format.
- Alternate Solution of Cron Job(Less...
Tuesday, March 24, 2015
Image Cropper

Image Cropper
How to use?
1- Click to "open" button & select image file.
2- Drag & select the portion of image.
3- Click on "select" button.
4- click on "save" button.
Image Cropper
Download here
...
Monday, March 23, 2015
Custom library in CodeIgniter
Custom library in CodeIgniter:
CodeIgniter is a MVC PHP Framework. Do you know this framework is very fast PHP framework. It is designed to create a dynamic, flexible & SEO friendly web application.
Now days CodeIgniter is very famous MVC framework. In past time when you work in Core PHP with OOP; you have developed own custom library which have...
Sunday, March 22, 2015
Fatal error: Call to a member function num_rows() on a non-object in
Problem:
While working with CodeIgniter you can get this "Fatal error: Call to a member function num_rows() on a non-object in...." error. You can also surprise that every thing is okay and every thing is okay in your sql.
Solution:
Some time you used different my sql Database name in local and production server, and you have mentioned wrong database...
Friday, March 20, 2015
Image Combiner

Combine all images from selected folder into one image.
This is a Free desktop software to combine multiple images into one single image.
There are no limit to combine , so you can combine unlimited images.
You need to select the folder where all images are existing.
This...
Wednesday, March 18, 2015
Change Search in This Blog size

Problem:
If you have a blog owner in blogger and used the "Search in This Blog" widget, you can see this size is very large and taking lot of spaces in your blog
Solution:
Use below code at the end of your blogger XML file
<script>
function r_search() {
var r_place_s="h2";
var...
Parse error syntax error unexpected end of file
Problem:
While working with PHP you may get this error
"Parse error: syntax error, unexpected end of file"
Solution:
If you missed the proper php tag <?php and used as below tag without configuration short tag <??>
Then you will get the "Parse error: syntax error, unexpected end of file" error message
Example:
So replace below tag
<??>
To
<?php
?>...
Tuesday, March 17, 2015
Get Internet Explorer Browser Urls lists

Get Internet Explorer Browser Urls lists
Get Internet Explorer Browser Urls lists
Download here
...
Get Internet Explorer Browser Urls list

Get Internet Explorer Browser Urls list
Get Internet Explorer Browser Urls lists
Download here
...
Lazy load image
If your site is loading slow then then main causes could be heavy images. So if you remove those images then your site load fast. but if those images are the main features of your product or web site then you will not remove those images. So what will you do?
Load those images one by one on demand then it will make difference when loading site.
So...
Saturday, March 14, 2015
Multiple word find replace in file

Problem:
Suppose you have many more files which having 5 words as below:
Alien
Time
Options
Customs
Robot
each one you want to replace with certain word, then what you will do?
For this you need to manually open each file and find replace operation many time.
You can make...
Friday, March 13, 2015
Load javascript file dynamic
How to Load javascript file dynamic by button click.
1) First create a javascript file "my_script.js" with below contents:
"my_script.js"
function ss(){ alert("aa");
}
2) Create a test.html file with below contents:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html...
bottom to top scroll in html
<!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" /><title>Untitled Document</title><style>#back-to-top { ...
jQuery Up Button
jQuery Up Button<!-- Load jQuery --> <script type="text/javascript" src="jquery-1.6.3.min.js"></script>
<!-- jQuery Up Button --><script type="text/javascript">//<
How to implement Google Gauge chart. The most important things is that how to change it's needle alternate with some interval. I have made the code that will change Gauge Google Chart's needle alternate interval.
Gauge chart in Google Chart
EXAMPLE - 1--------------------<!DOCTYPE...
Generate excel file in jsp java quickly
When you want to generate excel file in jsp java then you have lot of options,for ex: jexcelapi, Apache POI,other paid library.The problem is that the file; first will be created on hard disk then after read it and download to the user’s system.We all know that the .csv files open in excel software, so we can generate .csv file without any third party...
MPDF not inserting image in pdf
You may face this problem while working with MPDF when you generate pdf file. this is due to mpdf is not accept full url of image.for example this will no work:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCnfybluhgHSCRIheKE1OBIK11J0wE0xbBVKz5Wtni0_DBCUli5EzB9W_GTPcUSknpL7Yfg4xgngZbwg09rIvX-Fh7CvzWL5O3fIbIjQfbeQNNuyTgwfbHCtsAtUN9siO5_gMnqyXWMQY/s1600/video-watermark.jpg"to...
mysqli stmt return result
How to return result from mysqli stmt prepare and bind_param statement.Please note that you must install MySQL Native Driver (mysqlnd) driver to use get_result();DBClient.php<?php//error_reporting(E_ALL ^ E_DEPRECATED);class DBClient {var $host,$db,$user,$pass;var $mysqli,$isDBConnect;function __construct() { $this->host...
Php json and jquery
How to use PHP, JSON and JQUERYIt is very simple to use PHP, JSON and JQUERY. for this you needed to create two files.One file is "index.html", second file is "util.php" and this file the class file "DBClient.php" that will responsible for mysql database connection and return result according the sql query.index.html file call the util.php using jquery...
MPDF error Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in MPDF57\includes\functions.php
MPDF error Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in MPDF57\includes\functions.phpWhen you download MPDF from http://www.mpdf1.com/mpdf/index.php and working on it with latest version of PHP you may encounter following error:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback...
Create a simple page in Laravel using Controller
Create a simple page in Laravel using Controller1) Create a "ClientpagesController.php" file in "app/controllers/" folder as below contents<?phpclass ClientpagesController extends \BaseController { public function contactus(){ return View::make("contactme"); }}2) Open "app/routes.php" file and paste as:Route::get("contactus"...
Thursday, March 12, 2015
Create a simple page in Laravel using Route
Create a simple page in Laravel using RouteTo configure Laravel look here Here I am creating a simple "aboutus" page using "Routes" in Laravel.Follow below steps:1) Open "app/routes.php" file and paste as:Route::get('aboutus', function(){ return View::make('aboutus');});2) Now create "aboutus.php" in "app/views/" folder with...
How to create controller in Laravel
The two methods to create controller in Laravel.
A) By command prompt using "artisan controller:make" :
B) By manually creating controller.
To configure Laravel look here
A) By command prompt using "artisan controller:make" :
I am assuming you are using wamp 2.5.
1- Go to in the "c:\wamp\www\" folder
Open command window and cd...
Laravel Installation and configuration
First you need to install Composer from this link:https://getcomposer.org/download/Here you can find both installer for windows and Unix.If you are in windows then download here: https://getcomposer.org/Composer-Setup.exeBefore installing Composer check that you must have PHP 5.3 or later. I am assuming that you are using Wamp...
How to enable debug on in Laravel
How to enable debug on in LaravelWhile working with laravel Framework you could face this error "Whoops, looks like something went wrong."To overcome this error first you need to see what is the exact error in your code. to show exact error you need to set debug true in "app.php" file.Follow below steps:Open "\app\config\app.php" file.Set " 'debug'...
Url rewriting in Php
Very simple Url rewriting in PhpSuppose you have a website and you are operating it with query string as below:http://www.yoursite.com/computer.php?company=asus&name=s56cyou are using two query string "company" and "name". In "company" you are passing "asus" on the other-hand in "name" you are passing "s56c". So the question is that how to convert"http://www.yoursite.com/computer.php?company=asus&name=s56c" ...
Access mysql data using mysqli_connect in PHP Class
Access mysql data using mysqli_connect in PHP with mysqli_queryAccess mysql record by Object oriented method using class and object in PHP. Here is the class name is "DBClient" and it's method name is "exeQueryi()", that is return record from mysql table name "user_login". The __construct() method automatically called when we create any object of...
Show correct date time in PHP
You could be face a accurate Indian date time problem in PHP, because
web server located to USA or any other country. that's why date and time
which you are looking is wrong. but you can set it. so after set it you
can get the correct indian time. you only need to set timezome as
listed below:
<?php
date_default_timezone_set('Asia/Calcutta');
?>...
Export to excel in PHP
If you have a data and want to generate excel file of that data. then call this listed below function in php.public function exportToExcelUtil($filename,$data) {header("Content-type: application/octet-stream");header("Content-Disposition: attachment; filename=$filename");header("Pragma: no-cache");header("Expires: 0");echo $data...
Validate email in PHP
Here is the simple php function by this you can validate email which entered by any user.public function checkEmail($mailID) {$pat = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-.]+\.[a-zA-Z. ]{2,6}$/";if(preg_match($pat,$mailID)) {return true;} else {return false;...
Access mysql data using Class in PHP
Access mysql data using Class in PHP using mysql_connect and use mysql_select_db and mysql_queryAccess mysql record by Object oriented method using class and object in PHP. Here is the class name is "DBClient" and it's method name is "getDistrict", that is show records from mysql table name "district_names". The __construct() method automatically...
Latitude Longitude by address in php
You can find very easily Latitude and Longitude by given address with combination of Google map api and php.
You can easily implement in CodeIgniter,Laravel , CakePHP or any other framewok.
<?php
$address = 'Sector 37,Noida,India';
$geocode = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='...
Remove special character in php
You have a website and in that website you have lot of form for user. user fill many data via that forms. some time user feed special characters that are unreadable. so how to remove that special characters before inserting in data base? here is the few lines of code that will do it.<?php$input = "Fóø Bår this is the php form data ?A?B?C?D //\\?......!@#$%^&*()_+";...
Cell align top in dataGridView in c#
Use one line code as below:
dataGridView1.Columns["Question"].DefaultCellStyle.Alignment=DataGridViewContentAlignment.TopLef...
Get Volume Serial Number of Drive in C#
Listed below the code use in your project to get Volume serial number
//let's show C drive's volume serial numberString d = "c";try { System.Management.ManagementObject dsk1 = new System.Management.ManagementObject(@"win32_logicaldisk.deviceid=""" + d + @":"""); dsk1.Get(); string s1 = dsk1["VolumeSerialNumber"].ToString(); ...
SEND EMAIL FROM WINFORM
Some times you want to open microsoft outlook from microsoft winform and then type the mail message and send it. use below one line of code.System.Diagnostics.Process.Start("mailto:XYZ@XYZ.COM"...
HOW TO MAKE TRANSPARENT PNG FILE IN C# VB.NET .NET

Problem:
I was working a project where watermark in pdf file as text. but after some time requirement has been changed. the requirement is put watermark as png file in pdf instead of text. The first task was generate transparent png file in C# with given text. the text should...
PDF Water Marker

If you have a PDF with one page or more than one page and want to insert an image as a water mark in that PDF file then you can use this my software. Your are free to use this product.
PDF Water Marker
Before run this application you need to install .Net Framework...
GET MAC ADDRESS IN C# VB.NET
Problem:
Some time you want to develop a software in C# or Vb.net that will run only on specific computer system. for this you use mac address of that system.
Solution:
Here the C# code that will fetch mac address.
Example:
System.Net.NetworkInformation.NetworkInterface[] nic= System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();String...
SHOW FORM WITH IN FORM AS IMAGE

Problem:
Some time you have already created many form. then are opening separately when you click on any button in MDI Form or separate in C# winform. After soe time requirement has changed. the new requirement is to open new form in the same form from where you are...
Adding text in PDF File at specific position Freeware Software

Suppose you have a PDF file; which have one or more than one page and you want to insert text at the specific position. then in this situation you need to use PDF editor and goto each page and put the text at the position where you want. but if the pdf file is having 100 or...