• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
method accessing problem

#1
[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/catagory/Update/catagory/UpdateDetails

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/catagory/Update/catagory/UpdateDetails

how i can access the updateDetails mehtod

#2
[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.

#3
[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'); ?>

#4
[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.

#5
[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'); ?>
[/quote]


u r gr8 in codeigneter
u r doing axactly what i am not
doing.


again thanks buddy


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.