how to get the base url in javascript

Base URL in JavaScript You can access the current url quite easily in JavaScript with window.location You have access to the segments of that URL via this locations object. For example: // This article: // https://stackoverflow.com/questions/21246818/how-to-get-the-base-url-in-javascript var base_url = window.location.origin; // “http://stackoverflow.com” var host = window.location.host; // stackoverflow.com var pathArray = window.location.pathname.split( “https://stackoverflow.com/” ); // … Read more

the best way to make codeigniter website multi-language. calling from lang arrays depends on lang session?

Have you seen CodeIgniter’s Language library? The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization. In your CodeIgniter system folder you’ll find one called language containing sets of language files. You can create your own language files as needed in order to display error and other messages … Read more

Sending email with gmail smtp with codeigniter email library

$config = Array( ‘protocol’ => ‘smtp’, ‘smtp_host’ => ‘ssl://smtp.googlemail.com’, ‘smtp_port’ => 465, ‘smtp_user’ => ‘xxx’, ‘smtp_pass’ => ‘xxx’, ‘mailtype’ => ‘html’, ‘charset’ => ‘iso-8859-1′ ); $this->load->library(’email’, $config); $this->email->set_newline(“\r\n”); // Set to, from, message, etc. $result = $this->email->send(); From the CodeIgniter Forums

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)