Total Pageviews

Friday, June 24, 2011

Some Useful Php Tips

1) to get the file extension during file upload use:
$ext = strrchr($_FILES['file']['name'], '.');

2) To upload a large file, use following tips
pass 'MAX_FILE_SIZE' constant as a parameter and set its size.
this can be done by either defining it as a constant
define(MAX_FILE_SIZE,'1234561')
or passing it in hidden field like this





3) to get all the folders,without files

$dirs = array_filter(glob($path.'*'), 'is_dir');

Thursday, June 9, 2011

Calling dynamic data in every header file

Will answer it soon

IE session issue in Codeigniter

You can try following things:

1) If session is working fine in your system but having problem on the server,
then set the time of server. the problem occurs due to difference in time.

2) try to set the path like
$config['cookie_domain'] = "meerutwala.com";
$config['cookie_path'] = "/app";

because IE need domain name for cookie.

3) Try this also
change
$config['sess_cookie_name'] = 'ci_session';
to
$config['sess_cookie_name'] = 'cisession';
because IE don't like underscore in its name
4) if nothing is working for you then go for native session :(

Monday, June 6, 2011

How to view all stored procedures in phpmyadmin

To create a procedure write followong command

delimiter ;;
drop procedure if exists mishraa;;
create procedure mishraa()
begin
select ‘Ashutosh Mishra’;
end
;;

to view the stored procedure, run the below commands
SELECT *
FROM information_schema.routines

above query will fetch all the stored procedures in your MYSQL database

Wednesday, May 25, 2011

todays Tips

addAttribute: In my early age of programming , i used to be very fasicinated with this method.It is used to set the attribute of any element.But when i used it i come to know that it does not work well with IE :(So better to user Jquery addClass and removeClass for adding or removing classes dynamically.

opacity:It is used to reduce the opacity of iamge,div ,input box etc.
its syntax is opacity=0.4 for mozilla and chrome.
For IE use in the range of 0 to 100. ,menas 0.40 in mozilla means 4o in IE
For IE syntax is
opacity:alpha{filter:40}

Monday, May 23, 2011

Google Chart API Customization

1) To modify a horizontal chart to vertical one.
just change the method barchart to columnchart

2) To specify colors to the bar graph,
pass array of color codes to the graph.

3) You can give legend to the chart by specifying the position to the legend
top,bottom,right.

4) To make a vertical chart to stacked one specify isStacked:true.