Category

Codeigniter

Category

Step 1: Create Google App In this step, we have to create google app and then we will use google key and google secret on Codeigniter app. So go here: Google Recaptcha Admin. Step 2: <form action=’zohr_url’ name=’CMIGNITEWebToContacts’ method=’POST’ enctype=’multipart/form-data’ onSubmit=’javascript:document.charset=”UTF-8″; return checkMandatory()’ accept-charset=’UTF-8′ id=”contact-form”> <input name=”First Name” type=”text” maxlength=”40″ id=”First_Name” value=””/> <input type=’text’ style=’display:none;’ name=’returnURL’ value=’https://www.url.com/thanks’ /> <input name=”Email” type=”text” id=”Email” maxlength=”100″/> <button class=”g-recaptcha” data-sitekey=”6Lc0z7wZAAAAAL8_PxKh83_9AwIACideRGi0cSTH” data-callback=’onSubmit’ data-action=’submit’ id=’formsubmit’ type=’submit’>Submit</button> </form> <script> function onSubmit(token) { var…

Codeigniter 3 CRUD Operation with MySQL Database with example In this tutorial, I will cover CRUD operation with MySQL database with example in Codeigniter 3. You can check the step by step process we used a simple application having crud functionality in Codeigniter 3 with MySQL Database. CRUD operation is functionality in all application of familiarity with basic create, read, update and delete functionality with the Database. The Process of crud functionality. Step 1: Install…

1) Configure database connection Application/config/database.php Hostname, Username, Password, Database name $db[‘default’] = array( ‘dsn’ => ”, ‘hostname’ => ‘localhost’, ‘username’ => ‘root’, ‘password’ => ‘root’, ‘database’ => ‘code3’, ‘dbdriver’ => ‘mysqli’, ‘dbprefix’ => ”, ‘pconnect’ => FALSE, ‘db_debug’ => (ENVIRONMENT !== ‘production’), ‘cache_on’ => FALSE, ‘cachedir’ => ”, ‘char_set’ => ‘utf8’, ‘dbcollat’ => ‘utf8_general_ci’, ‘swap_pre’ => ”, ‘encrypt’ => FALSE, ‘compress’ => FALSE, ‘stricton’ => FALSE, ‘failover’ => array(), ‘save_queries’ => TRUE ); 2) Create…

RewriteEngine on RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} (sale|success|cancel) [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} !(static|sale|success|cancel) [NC] RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond $1 !^(index\.php|resources|robots\.txt|static) [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] ### Force HTTPS RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} ^www.websiteurl.com [NC] RewriteRule ^(.*)$ http://websiteurl.com/$1 [L,R=301]

Steps to remove index.php from URL 1. Change the index_page configuration like $config[‘index_page’] = ‘’; 2. Create .htaccess file and add the following code RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] After the configuration

change your application->config->config.php and set $config[‘sess_driver’] = ‘database’; $config[‘sess_cookie_name’] = ‘ci_session’; $config[‘sess_expiration’] = 7200; $config[‘sess_save_path’] = ‘ci_sessions’; $config[‘sess_match_ip’] = FALSE; $config[‘sess_time_to_update’] = 300; $config[‘sess_regenerate_destroy’] = FALSE; & Run SQL query CREATE TABLE IF NOT EXISTS `ci_sessions` ( `id` varchar(40) NOT NULL, `ip_address` varchar(45) NOT NULL, `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, `data` blob NOT NULL, PRIMARY KEY (id), KEY `ci_sessions_timestamp` (`timestamp`) );