Welcome Guest, Not a member yet? Register   Sign In
$this->uri->uri_to_assoc() Replaces Period "." (dot) With An Underscore "_"

Hi all, this has got me truely stumped so I am wondering if anyone has any ideas! Getting URI data using uri_to_assoc is replacing "." (period) with "_" (underscore). For example this basic controller :

<?php class Test extends Controller {
    function get_data() {
        echo '<pre>';
        echo '</pre>';

When given the URL "http://www.myurl.com/test/get_data/usern...hawes.test" outputs this :

    [username] => morehawes_test

I have also checked my config to ensure periods are allowed :

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

I would really really appreciate it if anyone could help with this Smile

Many thanks!

This is PHP functionality, it happens well before the uri gets to codeigniter.

[quote]The experienced may note that the actual variable names sent by the browser contains a period rather than an underscore, but PHP converts the period to an underscore automatically.

Hi noctrum, thanks for your swift reply. This is a big help - I was not aware of this behaviour. Infact on my localhost this is not happening at all, only on my hosting. Do you think this is being caused by register_globals being on? (off in my locahost and on in my hosting)

This is causing a big problem with my application so if this is the case I may try and get my hosting company to change this (using php_flag register_globals off in my htaccess file doesn't seem to work)

Hi again, just to let you know that I have fixed the problem by figuring out a work-around. Thanks again for your help Smile

Theme © iAndrew 2016 - Forum software by © MyBB