Welcome Guest, Not a member yet? Register   Sign In
the URL is showing twice!! really simple I think
#1

[eluser]xcodesane[/eluser]
Hello guys,
first post here, so sorry for not being too familiar with the forum. Ok so basically used the form loader:

Code:
class WebLogin extends CI_Controller {
        
    public function index(){    
        //$this->load->database();
        $this->load->helper('form');

        echo form_open('displaydetails/displayResults/');

        echo "Username : ". form_input('username', set_value('username'));
        echo "<br>Password : ". form_password('password', set_value('password'));
        echo form_submit('submit', 'Login');

        echo form_close();
  }
}

and then in the displaydetails/displayResults/ controller, I wrote simple echo:
Code:
class DisplayDetails extends CI_Controller {
        public function displayResults()
        {
        
            echo "form redirected correctly!";
        }
    }

then when I submit the login form, in the address bar the URL shows the following:

http://domainname.com/index.php/www.doma...layResults

as you can see twice the domain address is mentioned...why so? this is why I can't progress..
Thanks in advance.
K.S.A
#2

[eluser]xcodesane[/eluser]
18 views and no reply? is this a serious problem? I thought it would be common setting error Sad
#3

[eluser]cideveloper[/eluser]
what is your base_url and uri_protocol in config.php?
#4

[eluser]xcodesane[/eluser]
$config['base_url'] = 'www.f2bksa.com';
$config['uri_protocol'] = 'AUTO';

....
#5

[eluser]WanWizard[/eluser]
Impatient are we? Think we're all idling around until someone asks a question?

form_open() uses the site_url (a combination of 'base_url' and 'index_page') set in the config to construct the action, so I suggest you look at what you have configured there...
#6

[eluser]xcodesane[/eluser]
@WanWizard....no not impatient otherwise programming won't be the right thing for me to do Tongue
rather excited to know the relation between view counter and response counter...Big Grin
#7

[eluser]bhumes[/eluser]
I think you need to add a trailing slash to your base_url and you need to remove the trailing slash from your form_open argument.
#8

[eluser]Atharva[/eluser]
Try
Code:
$config['base_url']  = 'http://www.f2bksa.com';
#9

[eluser]xcodesane[/eluser]
Hey guys,
Thanks all for the replies...it is really nice to experience the community's support first hand.
I edited the config.php base url to null so
Code:
$config['base_url'] = '';
now my application works, and I hope this will not have side effect on any other implementation of codeigniter.
catch ya later Big Grin
K.S.A




Theme © iAndrew 2016 - Forum software by © MyBB