codeigniter

codeigniter I cant login

Hello, im trying to make a login script in codeigniter, but I only got a blank page, I want it to say "username or password is wrong" and if the username and password is right it should set session to true, hope some one can help me here is my code <?php class Login extends Controller { function index() { if ($this->...

MVC and Classic OO Paradigm. How to?

Hi, I'm a little bit confused about MVC and OO paradigms. I have read some documentation about classical OO in the book "The Object-Oriented Thought Process". Now I need to apply what I have learn in this book in the context of MVC pattern. How can I design from scratch using the OO paradigm and implement it in a MVC Framework like C...

Rewriting problem with .htaccess (removing /index.php from CodeIgniter URLs)

I have a small issue with some .htaccess rules on our website - http://www.presencemultimedia.co.uk We've recently re-built the website using CodeIgniter. To use nice URLs I've added some lines to our .htaccess file as below : RewriteEngine on # CodeIgniter rules (forwards requests to index.php) RewriteCond $1 !^(index\.php|images|rob...

How to paginate though a sorted table in codeigniter?

I'm using the default paginator to add the pae offset to uri(3) and the sort data is put in and associative array to uri like this in the table headers echo anchor("/contact/index/$paging/".$this->uri->assoc_to_uri($assoc),$column); at the moment i can sort desc and asc by clicking on the headers, but when i want to cycle through the ...

Convert all dates in PHP to local time.

The server my PHP script is running on is set to UTC. I can't seem to figure out a way to set all dates to the browser's timezone. All dates displayed are formatted using PHP's date() function. I know that via JavaScript's getTimezoneOffset() function, I can get the browser's current UTC offset (-4, in my case). How can I tell PHP to...

passing values from model to view in CI

Hey guys, I have this library in CI that retrieves my latest twitter updates. It has a function that sends my latest updates as objects to my controller. I would like to show these twitter updates on the footer of my page, so they're visible at all times. Now my question is how I call these directly from a view? I know this is not a g...

Build an application

I want to build a application in codeignitor. Anybody, have any good ideas for something for me to build? ...

Apply UUID function to database field from PHP

Hi all, I have this CodeIgniter and MySQL application. I have a database table where one field must be unique. When I "delete" a record from the table I don't want to really remove it from the table, I just want to set free the value of the unique field so it can be used for a future new record without conflicts and leave it there. At...

Codeigniter portnumber in url

im using code igniter current version .I moved all the files to the live server i access URl as http://xxx:8084/application/ My class does not seem to load ,$this also does not work It stops executing before parent::controller ,i get call to a function model on non object ...

Echo Javascript Alert Before Redirect, usleep(2000000)? - PHP CodeIgniter

Hello, I'm trying to have a javascript alert, after a database interaction and before a page redirect (back to the same page, but displaying the updated data). I thought having a pause before the redirect with usleep() might work, but it seems to ignore it. If I comment out the redirect it takes me to the controller page, where the ale...

Validating a date dd/mm/yyyy

Hi, Does anyone know of any good functions for validating a date via input text box in codeigniter like this: dd/mm/yyyy? Thanks ...

how to call php functions from a javascript function to access a database

hi, how do you call php function that is in a different file from a javascript function. I have a javascript function that recieves a variable frm an onclick function. The varaible is an id that I will use to retrieve data from mysql database. The variable is then pass on to php function that will access the database to get the data an...

Codeigniter call function within same class

Hi, I am trying to do this code in my Codeigniter application <?php class Inventory extends Controller { function current_stock() { //do something } function add_stock() { //do something-else ****then do function current_stock()***** } } How do I execute another function from within a second one. The approach outlined here (about ...

codeigniter get time zone offset

i need to get the timezone offset value from the timezone data in codeigniter. Timezones i have are UM12, UM11, .... UTC.... UP10 UP11 UP12..... i need exact offset values. is there any direct method? ...

codeigniter localhost setup 404 page not found error

I have a localhost setup(i use apache's virtualhost setup) for a site I am working on with codeigniter. I use SVN for the site. I decided to change the localhost-domain name and the root-folder name(this is the folder from within which I check out SVN) to which the localhost-domain points. To show a better picture, I changed; sledge-...

Portable View Engine Options (PHP / ASP.NET)

With MVC possible in both ASP.NET MVC and PHP (CodeIgniter, CakePHP etc) what are the options when it comes to using a view engine that could work with both platforms, enabling copy/paste without any changes? Ones I can think of are: NHaml / PHPHaml (not updated for 3 years though) / PHamlP I am assuming this works with CodeIgniter or...

When I inserting AT&T it will add semicolon in code igniter

Hello, Whenever I was inserting AT&T to database it was added as AT semicolon is added extra in code igniter. My code is like this: $this->input->post('carrier_name'); $this->db->insert('cs_carrier',$insert); please suggest. ...

How can you run a mysqli query with CodeIgniter?

Hello guys, Does anyone have a clue how to run a mysqli query with CI. I did change the db driver in the config file, but I'm still unable to use multiple queries like $sql = "SELECT * FROM c WHERE 1; DROP TABLE IF EXISTS c;" $query = $this->db->query($sql); Anyone has any clue how to do this using only CI, no additional libr...

how to separate data access layer in codeigniter

Hi, I used to write the data access functionalities in model itself. Now I want to separate data access from business logic. I am using codeigniter as framework. It seems that one way of doing it is use ORM, but it will have a performance penalty I guess. are there any general best practices? ...

How it will be if we can use PDO with CodeIgniter?

PDO for SQLite3 is done already. Have you got any way to use PDO with CodeIgniter for other Databases? How did Codeigniter skip PDO for other databese-servers, I dont get it. Expect you may know better and can pick us up. EDITED: Any tricks/way to build our own PDO class is highly appreciable. ...