Welcome Guest, Not a member yet? Register   Sign In
How can I convert this "get_cities.php?country='+country" to CI way?
#6

[eluser]Craig A Rodway[/eluser]
View:

Code:
$.get('phpjquerybook/get_cities/'+country, show_cities);

Well done - it looks like you have the correct URL there now.

Controller:

Code:
function get_cities(){
        
        switch(@$_POST['country']){

Two reasons why you shouldn't be using $_POST. Firstly, in CI, you would use $this->input->post('country');. But secondly, your javscript code is sending a GET request, not a POST request.

This modified code should work:

Code:
function get_cities($country = ''){
        
        switch($country){
        ...


Messages In This Thread
How can I convert this "get_cities.php?country='+country" to CI way? - by El Forum - 01-08-2010, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB