Welcome Guest, Not a member yet? Register   Sign In
_GET array problem...
#1

[eluser]XssLab[/eluser]
Hello, I have a problem with a
Code:
$this->input->get();

method to obtain a _GET value of url in my web site...

For example, the url string is:

Code:
upload_form/?id=11&type=0&image_type=screenshot

And my code is:

Code:
function upload_form()
    {
        $this->logged_in();
        
        if($this->input->get('image_type', TRUE) == 'screenshot')
        {
            $this->load->view('upload_image_form');
            return false;
        }
        else
        {
            $this->load->view('upload_plant_form');
            return false;    
        }
    }

But the conditional if doesn't work!

where is the problem of ->input->get method?
#2

[eluser]Pascal Kriete[/eluser]
CodeIgniter sanitizes all GET values unless you turn enable_query_strings on in the config file.

You can get both clean urls and GET by setting the aforementioned setting to TRUE and using PATH_INFO for your uri_protocol (also set in the main config file).
#3

[eluser]XssLab[/eluser]
Thanks Wink

Very good!
#4

[eluser]XssLab[/eluser]
But with PATH_INFO ... the problem doesn't change...
#5

[eluser]Pascal Kriete[/eluser]
Did you also turn enable_query_strings on?
#6

[eluser]XssLab[/eluser]
Yes...and I use .htaccess file (but this is no very important...)
#7

[eluser]XssLab[/eluser]
Sorry, I have resolved my problem Smile

Thanks inparo Wink
#8

[eluser]Pascal Kriete[/eluser]
Glad you got it sorted. For anyone that finds this in the future, could you tell us know where the hitch was?
#9

[eluser]XssLab[/eluser]
Yes,

a problem with .htaccess..., the rewrite base / url doesn't work correctly Wink




Theme © iAndrew 2016 - Forum software by © MyBB