Browsing all articles from June, 2010
Jun
30

Ajax Tutorial: Dynamic Loading of ComboBox using jQuery and Ajax in PHP



Here is a script for beginners to create a dynamic loading of dropdown. Simple solution which is created by jQuery.

Jun
30

Live Username Availability Checking using Ajax and jQuery. Demo Available


Simple script to check username availability using jQuery and Ajax. Try out demo and use it. I used gif loader and jquery fade in effects to make it fit. You can find many script like this but i want to keep my valuable users here to share their development needs.

Jun
30

CodeIgniter Tutorial: Upload and Convert video to FLV using FFmpeg.


Today, I will show, how can we upload and convert a video file to flv using FFmpeg in CodeIgniter website. FFmpeg commands runs in Linux but in Window server we need to download FFmpeg.exe file from its site. Which we have to put in our site root folder. IF your server is Linux then you also need verify that your hosting server has FFmpeg installed or you need it to be installed. For checking FFmpeg availability print phpinfo() in any file and run this command on server where you will get PHP version and other server settings. Find FFmpeg on that window if it doesn’t found then it means server has no FFmpeg installed.

Here is uploading code of video file in CodeIgniter.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$file				= 'video_file';
$config['upload_path']		= './video_folder/';
$config['allowed_types'] 	= 'mov|mpeg|mp3|avi';
$config['max_size']		= '50000';
$config['max_width']  		= '';
$config['max_height']  		= '';
 
$this->upload->initialize($config);
$this->load->library('upload', $config);
 
if(!$this->upload->do_upload($file))
{
	// If there is any error
	$err_msgs .= 'Error in Uploading video '.$this->upload->display_errors().'<br />';
}
else
{
	$data=array('upload_data' => $this->upload->data());
	$video_path = $data['upload_data']['file_name'];
 
	$directory_path 	 = $data['upload_data']['file_path'];
	$directory_path_full      = $data['upload_data']['full_path'];
	$file_name 		= $data['upload_data']['raw_name'];
 
	// ffmpeg command to convert video
 
	exec("ffmpeg -i ".$directory_path_full." ".$directory_path.$file_name.".flv"); 
// $file_name is same file name that is being uploaded but you can give your custom video name after converting So use something like myfile.flv.
 
	/// In the end update video name in DB 
	$array = array(
		'video' => $file_name.'.'.'flv',
		);
	$this->db->set($array);
	$this->db->where('id',$id); // Table where you put video name
	$query = $this->db->update('user_videos'); 	
}
Jun
29

zGrid: Best PHP/AJAX Grid System. Good for Newbie web developers

Author ZeeShaN    Category AJAX, JQuery, PHP, Web Development     Tags ,

Few days ago I have developed a Grid system using PHP, jQuery and Ajax. I want to share this with my dear users. It is not very well parametrized or generic but if have little much understanding of jQuery and Ajax then its easy to use. Give your feed back about zGrid.

Jun
29

Live Query Plugin: Solution of your problems in jQuery

Author ZeeShaN    Category JQuery, Web Development     Tags

Some one asked me about the solution of binding events to dynamically generated elements. And one name came in my mind that is LiveQuery. If you have used jQuery very well and worked on some dynamic created content using jQuery Ajax, then you must faced links binding problem to these new elements.

For example:

If you are performing some delete action on click of any element using its ID.

$('a#someID').click(function(){
// your code
});
// or something like
$('a#someID').mouseenter(function(){
// your code
});
// or something like
$('a#someID').focus(function(){
// your code
});

And if there are some dynamically generated links that also hold id “someID” then they won’t work. To get the solution of this problem, Brandon Aaron (jQuery team member) developed a plugin called LiveQuery plugin which binds the events to these dynamically generated elements.
Now if you have some dynamically generated elements. Use your event like this:

$('a#someID').livequery('click', function(e) {
// your code
});
// or something like
$('a#someID').livequery('mouseenter', function(e) {
// your code
});
// or something like
$('a#someID').livequery('focus', function(e) {
// your code
});

I have used this plugin in my zGrid development







Enter your Email:

Click Here for Popular

Who I Am

Zeeshan Rasool

Software Engineer - PHP
Lahore - Pakistan

zeeshan(@)99points.info
Skype: zeeshan-rasool
gTalk: zishan.rasool85

Categories

Tags

Comments