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