Posts

Showing posts with the label codeigniter

Uploadify with IE (Internet Explorer) destroy the session or reset the session in Codeigniter.

I was totally Fed up with this that why session destroyed every time when i upload a file in IE browser. I was using codeigniter and on a form i use uploadify, When i upload a photo and click on submit it take me on login page when i was login what is the problem with that. So Finally i solved this problem, Please take a look Open app/config/config.php In your config.php you can set your $config['sess_match_useragent']= FALSE;  When doing this CI 2.0 atleast, won’t create a new session for the flash object, and thus not kill your current session in IE.

Force Redirect http:// to https:// in codeigniter by .htaccess

Force Redirect http:// to https:// in codeigniter by .htaccess simply copy and paste this code in htaccess of root  to redirect http:// to https:// # Enforce SSL https://www. RewriteCond %{HTTPS} !=on RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

How to create custom 404 redirect in codeigniter?

How to create custom 404 redirect in codeigniter? there are lots of post on website which told you about custom 404 redirect in codeigniter but most of them are worth less. Give a minute on this post and you will see this blog give exact what you want. Step first: Create a file in your controller errors.php and paste this code in this file <?php class Errors extends Controller { function Errors() { parent::Controller(); } function error_404() { $this->load->view('error_404'); } } ?> Step Two:  Create a file in your View folder name as error_404.php and write you error msg in this page Step Three: Now opne this file   yoursite/system/core/ Common.php and search this function  show_404() Please note: in many version common.php file in another folder so you can search for this file on this root also  yoursite/core/codeigniter/Common.php A nd replace this code with this function function show_404($page = '') { he

How to remove index.php from Codeigniter URL or .htaccess and codeigniter not working?

After  after visiting so many sites  article i solve this problem that why its not working with index.php or why sub page links are not working without index.php I think all article has same copy and paste code on their website that's why you are wondering here and there ... try this code i think this will definitely work for you if your site is uploaded on root of website than open you htaccess from you root and paste this code on you htaccess Options +FollowSymLinks All -Indexes Options All -Indexes DirectoryIndex index.php RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L] if your site is inside in sub-folder of any site like www.site.com/yoursitefolder/ so you have to paste this code on your htaccess file of your codeigniter site Options +FollowSymLinks All -Indexes Options All -Indexes DirectoryIndex index.php RewriteEngine on RewriteBase /yoursitefolder Rewrit

How to save an image with image validation in new folder in php?

If you want to save an image on a new folder which will create on run time and with image validation , then simply copy and paste this code and change the name of image field name and you can replace $id to your folder name. $id=$_POST['id']; $last_url = $_SERVER['HTTP_REFERER']; if(!empty($_FILES['uploadedfile']['name'])){ $imgExtension = array("jpg","jpe","jpeg","gif","png","GIF","JPG","JPEG"); $image_name = pathinfo($_FILES['uploadedfile']['name']); $extension = strtolower($image_name['extension']); if(in_array($extension,$imgExtension)){ $file_name = $_FILES['uploadedfile']['name']; $ext = end(explode('.',$file_name)); $folder_path = 'public/uploads/auction/'.$id; $save_path  = 'public/uploads/auction/'.$id.'/'.$file_name; $path  = 'publ

internal error or misconfiguration in codeigniter or php

 internal error or misconfiguration in codeigniter or php Internal Server Error  The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator , admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. so please Make sure your apache has mod_rewrite activated LoadModule rewrite_module modules/mod_rewrite.so If it is commented out (# in front), make sure to uncomment it and save the file. Checking if the corresponding module exists may be a good idea as well (but it usually does). IN simple language go on your running wamp or xampp click on that  and go on apche section and click on httpd.conf file and search mod_rewrite.so and remove the # in the front of line (# is use for comment)