method accessing problem |
[eluser]hamzakhan[/eluser]
i have update form with this url http://localhost/server/sscart/admin/catagory/Update/64 and form action <form action="catagory/UpdateDetails" method="post"> controller/method but the problem is that when i submit the form the url will look like this http://localhost/server/sscart/admin/cat...ateDetails catagory/UpdateDetails UpdateDetails -- is a method in catagory controller.which is updating the values of the form and UpdateDetails is not accessable with this url http://localhost/server/sscart/admin/cat...ateDetails how i can access the updateDetails mehtod
[eluser]richzilla[/eluser]
When you submit your form its submitting to a url relative to its existing url. So if your already on catagory/update it will simply add the whatevers in the action parameter to the end of that. The simplest solution is to use CI's form helper and use the form_open method, which will direct you to the correct url.
[eluser]richzilla[/eluser]
So at the top of your controller (or in your autoload file): Code: $this->load->helper('form') And in your view, where you have the html form element, replace that with: Code: <?php echo form_open('catagory/UpdateDetails'); ?>
[eluser]hamzakhan[/eluser]
[quote author="ricardino" date="1259688380"]When you submit your form its submitting to a url relative to its existing url. So if your already on catagory/update it will simply add the whatevers in the action parameter to the end of that. The simplest solution is to use CI's form helper and use the form_open method, which will direct you to the correct url.[/quote] Thanks you so much for this help now its working according to my expectations.
[eluser]hamzakhan[/eluser]
[quote author="ricardino" date="1259688707"]So at the top of your controller (or in your autoload file): Code: $this->load->helper('form') And in your view, where you have the html form element, replace that with: Code: <?php echo form_open('catagory/UpdateDetails'); ?> u r gr8 in codeigneter u r doing axactly what i am not doing. again thanks buddy |
Welcome Guest, Not a member yet? Register Sign In |