Welcome Guest, Not a member yet? Register   Sign In
  Securing applications
Posted by: El Forum - 10-30-2008, 06:31 AM - Replies (5)

[eluser]Billy Khan[/eluser]
As a rule, i xss_clean all data passed into codeigniter from POST/GET forms and URLS.

Is this enough?, having done this and basic data validation can i assume the application is secure as it can be? Or should i also be escaping them using db->escape as well as native mysql PHP functions.


  Need Help with integrating Plaxo widget (email addresses import) with CI
Posted by: El Forum - 10-30-2008, 06:01 AM - No Replies

[eluser]Jimmy - IND[/eluser]
I have problem integrating it with CI .. anyone have done it before?

Any help would be appreciated ... I don't have prolems using it with native code php pages

but can't seem to used it in CI, not sure if the issues is the url with CI ..


  How do I output XML in the view?
Posted by: El Forum - 10-30-2008, 05:52 AM - Replies (8)

[eluser]RedLeader[/eluser]
Hello everyone,

Sorry for what appears to be a very noob question but I don't know if I am outputting XML to the view properly.

When I try to do it I put the following in my view file called "response_view.php":

Code:
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<response>
    <type>&lt;?php echo $type ?&gt;</type>
    <message>&lt;?php echo $message ?&gt;</message>
</response>

Is that good enough?

Thanks for any help you can offer!


  CI 1.7 form_validation bug regarding callbacks
Posted by: El Forum - 10-30-2008, 05:27 AM - Replies (8)

[eluser]Bogdan Tanase[/eluser]
Hi,

I'm not 100% sure, but I think I've spotted a bug that in some cases prevents execution of more than one callback function:

In Form_validation.php we have the following snippet at line 610:

Code:
// If the field isn't required and we just processed a callback we'll move on...
if ( ! in_array('required', $rules, TRUE) AND $result !== FALSE)
{
   return;
}

I'm pretty sure that instead of return we should have continue, otherwise the next rule will not execute.


  How to $_GET on Paypal success transaction
Posted by: El Forum - 10-30-2008, 04:42 AM - Replies (3)

[eluser]achilez[/eluser]
Hi, Im new here, I have a website that accepts credit card via paypal, I have a problem on getting the information from paypal when the transaction is successful.

Example:
http://www.mysite.com/return/?param1=123...am4=123456

how can i get the value of param1, param2, param3 etc? because i want to save it on db.

I tried getting the values via $_GET like below and it didn't work:
print_r($_GET);

I know that CI get rid of $_GET function for security reasons. Just want to know how to get those values in easy as 123.

Hope that you can help me Smile

Thanks

Archie Mercader
http://www.outsourceincebu.com
http://www.powersearchengine.net
http://www.myyahogle.com
http://www.adrinclexpn.com
http://www.americandreamreview.com


  Active Record and JOIN
Posted by: El Forum - 10-30-2008, 04:31 AM - Replies (12)

[eluser]Firstrow[/eluser]
I have question about AC left join.

I'll try to explain.

For example I have one table in db named 'acticles' and other table 'comment' which have all comments to some page.

Task: select some page and all comment for this page in one request to database. Now my code is:

Code:
$this->db->from('articles');
      $this->db->join('comments', 'comments.acticle_id = articles.id','left');

      $this->db->where('articles.id',$some_id);

      $query = $this->db->get();
      $rezult = $query->result_array();


But, after this request I've received one page as many times as there are comments.

Now question, How i can receive array like that:

Code:
array(
'id' => '1',
'title' => 'Page Tile',
'comments' => array(
                    'coment_id' => 1,
                    'coment_text' => 'Text goes here'
                    ),
                    array(
                    'coment_id' => 2,
                    'coment_text' => 'Text2 goes here',
                    )
);

or how is right to use CI Active Record with Left Join?
any suggestions?


  Zip date problem
Posted by: El Forum - 10-30-2008, 03:24 AM - Replies (2)

[eluser]Geoffrey[/eluser]
I'm currently using CI 1.7.0 and I have a couple of tab delimited files I'm creating as strings and then adding the strings to a zip file to download. Everything works as expected except when I unzip the file downloaded, the 2 files I added have creation dates of 30/11/1979 12:00AM instead of 30/12/2008 10:22pm.

The zip file itself comes down fine. It's only the files inside the zip that are incorrect.


  where can i put my own function
Posted by: El Forum - 10-30-2008, 02:04 AM - Replies (3)

[eluser]syntaxerror[/eluser]
hi,
can anyone please help me.
i have my own function that makes an array to lower case (strtolower)
because php has no built in function to convert array to lower case
i make my own function.
my question is where should i put this function in code igniter?
model?view? or controller?

BTW my script is

Code:
function arraytolower($array,$round = 0){
    foreach($array as $key => $value){
        if(is_array($value)) $array[strtolower($key)] =  $this->arraytolower($value,$round+1);
        else $array[strtolower($key)] = strtolower($value);
        }
        return $array;
    }

thanks


  Image resizing locks the image
Posted by: El Forum - 10-30-2008, 12:40 AM - Replies (3)

[eluser]@li[/eluser]
Hi,

I have some code on my website which lets a user upload their image (using the CI upload library), then attempts to resize it (using the CI image manipulation library). However after resizing, the image seems to get locked, if I try to download/view it (on my website) it says permission denied, you can't access this image, etc.

This works fine on my localhost (a windows XP machine using WAMP) but on the website which is probably a linux server, it seems to lock the image after resizing it.

Has anyone experienced this or has any ideas?

Here's my code in case it helps:

Code:
$config['upload_path'] = $dir;
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '2000';
        $config['encrypt_name']    = true;
        
        $this->load->library('upload', $config);
        
        if (! $this->upload->do_upload('pic'))
        {
            $this->upload_err=$this->upload->display_errors();
            $this->index();
            return false;
        }
            extract($this->upload->data());
                if ($image_height > $height_allowed || $image_width > $width_allowed)
        {    
            unset($config);
            
            $config['image_library'] = 'gd';
            $config['source_image']    = $full_path;
            $config['create_thumb'] = false;
            $config['maintain_ratio'] = TRUE;
            $config['width']     = $width;
            $config['height']    = $height;
            
            $this->load->library('image_lib', $config);
            
            $this->image_lib->resize();
        }


  "Unable to load the requested class: form_validation"
Posted by: El Forum - 10-29-2008, 11:42 PM - Replies (8)

[eluser]Bl4cKWid0w[/eluser]
I'm trying to use the form validation class, however, it doesn't seem to be working correctly. This is my code:

Code:
$this->load->helper('form');
           $this->load->library('form_validation');
      $this->form_validation->set_rules('clanName', 'Clan Name', 'required|callback_clanname_check|min_length[5]|max_length[50]');
      $this->form_validation->set_rules('clanMotto', 'Motto', 'required|min_length[5]|maxlength[250]');
      $this->form_validation->set_rules('clanEmail', 'Email', 'required|valid_email');
      
      if($this->form_validation->run() == FALSE){
        $this->load->view('ladders_join', $data);
      } else {
        $this->load->view('ladders_joined');
      }


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Error / Shield 1.0.3 + Ci...
by kcs
30 minutes ago
Integrating Bootstrap 5 i...
by tarcisiodev1
6 hours ago
Asset Minification Packag...
by tarcisiodev1
6 hours ago
Modify users data as an a...
by luckmoshy
6 hours ago
Is it possible to go back...
by ejimenezo
Today, 11:49 AM
SQL server connection not...
by davis.lasis
Today, 07:11 AM
Validation | trim causes ...
by Gary
Today, 05:09 AM
Problem with session hand...
by Julesb
Today, 04:13 AM
External script access to...
by PomaryLinea
Today, 03:58 AM
VIRUS reported after Chro...
by InsiteFX
Yesterday, 11:34 PM

Forum Statistics
» Members: 85,510
» Latest member: dulichdongthap
» Forum threads: 77,586
» Forum posts: 376,026

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB