Category Archives: CodeIgniter

Dynamic base url : CodeIgniter and Zend Framework

1 2 3 $base_url = ((isset($_SERVER[’HTTPS’]) && $_SERVER[’HTTPS’] == "on") ? "https" : "http"); $base_url .= "://".$_SERVER[’HTTP_HOST’]; $base_url .= str_replace(basename($_SERVER[’SCRIPT_NAME’]),"",$_SERVER[’SCRIPT_NAME’]);  

Posted in CodeIgniter, PHP, Zend Framework

Run PHP from HTML – .html as .php – Execute PHP in .html

How can I execute PHP code on my existing myfile.html page?: When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it … Continue reading

Posted in CodeIgniter, PHP, PHP-Tips

Insert accounts in Sugar CRM using Codeigniter

//load new database of Sugar CRM as defined in database.php $this->db2 = $this->ci->load->database(’db_crm’, TRUE);   //generate unique id for sugar crm . length:36 $accounts_id=$this->generateCrmID(’accounts’);   //insert account into CRM $account_data=array( ‘id’=> $accounts_id, ‘name’=> $user_details[’first_name’].’ ‘.$user_details[’last_name’], ‘date_entered’=> date(’Y-m-d h:i:s’), ‘date_modified’=> date(’Y-m-d … Continue reading

Posted in CodeIgniter, PHP Tagged , ,

Insert ticket in Support Suite using CodeIgniter

// Insert the Actual Record $ticket_data=array( ‘ticketid’=>”, ‘ticketmaskid’=>$ticketmaskid , ‘departmentid’=>1 , ‘ticketstatusid’=>1 , ‘priorityid’=> 1, ‘emailqueueid’=>0 , ‘userid’=>68 , ‘staffid’=>2, ‘ownerstaffid’=>2, ‘assignstatus’=>1, ‘fullname’=>’someva’ , ‘email’=>$user_details[’email’] , ‘lastreplier’=>’someva’ , ‘replyto’=>$user_details[’email’] , ‘subject’=>’New Account is registered’ , ‘dateline’=>now() , ‘lastactivity’=>now() , ‘laststaffreplytime’=>now() … Continue reading

Posted in CodeIgniter, PHP Tagged , ,

SEO based urls : CodeIgniter routes

You can use this code for SEO urls   //this section enables you to use some controllers $route[’admin/(:any)’] = "admin/$1"; $route[’contact/(:any)’] = "contact/$1"; $route[’auth/(:any)’] = "auth/$1"; $route[’testimonials/(:any)’] = "testimonials/$1";   //else everything in url will handle by this pro controller’s … Continue reading

Posted in CodeIgniter, Newbie, PHP Tagged ,

Automatic Config BASE URL in CodeIgniter

Change $config['base_url'] with this. This is one time set config system for all sites and urls. In application/config folder open config.php Find this $config[’base_url’]=’http://example.com’; and replace with this   $config[’base_url’] = ((isset($_SERVER[’HTTPS’]) && $_SERVER[’HTTPS’] == "on") ? "https" : "http"); … Continue reading

Posted in CodeIgniter, PHP Tagged , , ,

Insert user in Support suite using CodeIginiter

Paste following code in end of database.php located in config folder $db[’db_support’][’hostname’] = "localhost"; $db[’db_support’][’username’] = "dbname"; $db[’db_support’][’password’] = "password"; $db[’db_support’][’database’] = "supportsuite_databasename"; $db[’db_support’][’dbdriver’] = "mysql"; $db[’db_support’][’dbprefix’] = ""; $db[’db_support’][’pconnect’] = TRUE; $db[’db_support’][’db_debug’] = TRUE; $db[’db_support’][’cache_on’] = FALSE; $db[’db_support’][’cachedir’] = … Continue reading

Posted in CodeIgniter, PHP, PHP-Tips Tagged , ,

Payment getway API for CodeIgniter using yahoo finance : A CodeIgniter Payment Library

  < ?php if ( ! defined(’BASEPATH’)) exit(’No direct script access allowed’); /** * Copyright 2007 Yash Bhardwaj <info@speedovation.com> * Copyright 2007 Harvey Kane <code @ragepank.com> * Copyright 2007 Michael Holt </code><code @gardyneholt.co.nz> * Copyright 2007 Melanie Schulz <mel @gardyneholt.co.nz> … Continue reading

Posted in CodeIgniter, PHP