hi friends,
how come have the code before hacked with SQL Injection :(
$query = $this->db->query("SELECT * FROM users WHERE username = ? AND password = ?", array(mysql_real_escape_string($this->input->post('username')), mysql_real_escape_string(MD5($this->input->post('password')))));
appreciate helps!!
...
I'm having quite a challenge creating an appropriate rewrite rule for Apache/2.2.14 on Fedora 10. I'm working through the CodeIgniter-Doctrine tutorial which uses an .htaccess file. (Search for Removing “index.php” from CodeIgniter urls about 10% down.) But since that's not recommended for a production server, I'm trying to tweak it to...
I figured out how to pass one.. but how do I pass multiple GET variables from a FORM?
...
I've developed a website in php codeigniter with the idea of using single physical instance of the code.
Here the logic i wanted to be is on login page user will chose the companyid which will be internally to the database name.
I want to know how to update the active_group variable according to the company id chosen by the user at the ...
I just figured out that all code completion for Eclipse is stored in plain files located here (example):
.\eclipse\plugins\org.eclipse.php.core_2.1.1.v20090921-1100\Resources\language
I tried adding global variables like $_POST, $_GET, $_SERVER to the end of basic.php but without any luck (did try to restart Eclipse).
Is there a w...
This is what my .htaccess looks like. The .htaccess is sitting in /www/scripts directory which is the parent of codeigniter's "system" directory and which also contains index.php. I have enabled mod_rewrite in my Apache 2.2.x. This is on Ubuntu 9.10 server.
I followed this link, but it does not work. Is there anything i need to do in ap...
how do i get the value of hidden field from controller?
i tried this:
$hidden=$this->input->post('hidden_field_name');
it showed error. The field name is correct, i double checked it.
...
Hello,
I am trying to increment a INT column by 1 if a certain field is not null on an update request, currently I have this update too columns,
public function updateCronDetails($transaction_reference, $flag, $log) {
$data = array (
'flag' => $flag,
'log' => "$log"
);
$this->db->where('transaction_refere...
Hi!
Iam fighting following problem with little success.
I want to block hotlinking to images in static folder from other domains than my_domain.com
htaccess looks like this:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?my_domain\.com [NC]
RewriteRule \.(gif|jpe?g|js|css)$ - [F,NC,L]
Rewr...
How can I select rows from two or more tables?
I'm setting default fields for a form, and I need values from two tables...
My current code reads:
$this->CI->db->select('*');
$this->CI->db->from('user_profiles');
$this->CI->db->where('user_id' , $id);
$user = $this->CI->db->get();
$user = $user->row_array();
$th...
I am using the get_where() function in codeigniter, and I am getting mysql errors, dependent on what I set the limit and offset too, for example this code,
$this->db->get_where('em_user', $whereArr, 30, 0)->num_rows()
returns a mysql error that looks like this,
Error Number: 1064
You have an error in your SQL syntax...
Hello,
I would like to store images in my mySQL database using the CodeIgniter PHP framework.
How do I write and read the image?
Thank you.
...
Alright Im using the BambooInvoice software, and where I am, we have two sales taxes.
This is how they work
price of item * tax1 = Sum1Tax1
Sum1tax1 *tax2 = Final sales price
Currently, Bamboo invoice does this
Price of Item * tax1 = pricetax1
price of item * tax2 = pricetax2
Price of item + pricetax1 + pricetax2
and this is its co...
CodeIgniter claims do sanitize POST variables. I'm also using DataMapper which I believe also does it's own thing. I would like to double check to make sure it's doing what it's supposed to be doing. How can I do this?
I'd like to test this without destroying anything, would typing random escaped characters work? What should I see enter...
Hello,
I think this is a simple one.
I have a Codeigniter function which takes the inputs from a form and inserts them into a database. I want to Ajaxify the process. At the moment the first line of the function gets the id field from the form - I need to change this to get the id field from the Ajax post (which references a hidden ...
I want to learn the whole details of web application authentication. So, I decided to write a CodeIgniter authentication library from scratch. Now, I have to make design decision about how to determine whether one user is login.
Basically, after user input username & password pair. A cookie is set for this session, following navigations...
Hi,
My codeigniter project is in live.
I have two copies of it. One in the root and another in a subfolder.
Both are configered to work normal.
The root copy if the one which was made after testing in a subfolder.
While running from the a subfolder all worked well.
But when copied to the root folder the default controller is loading fo...
I'm trying to redirect all routs to one main controller. Here is my routes.php
$route['default_controller'] = "main";
$route['scaffolding_trigger'] = "";
//$route['(\w{2})/(.*)'] = '$2';
//$route['(\w{2})'] = $route['default_controller'];
$route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1";
$route['(:any)'] = $route['d...
I'm adding some models to a project, and was wondering if there is a "best practice" kind of approach to creating models:
Does it make sense to create a function for each specific query?
I was starting to do this, then had the idea of creating a generic function that I could pass parameters to. e.g:
Instead of
function getClients(){...
hi y'all,
Hope i caught everyone doing alright. I have a small question to ask. I am developing a small site for a client and instead of using the email class with codeigniter I have chosen to use phpmailer for php5 which i found on a previous project hassle free when I used it with google last year.
This client is using godaddy's mail ...