Welcome Guest, Not a member yet? Register   Sign In
Show validation errors, well not today????
#15

[eluser]jbreitweiser[/eluser]
Make you post tag have action="city2go.net/test/banksy/1". Use the URI class to get that segment. So in this example test is the class and banksy is the method you are calling. URI is a default class so you do not need to load it. refer to http://ellislab.com/codeigniter/user-gui...s/uri.html for how to write urls with parameters.

Code:
class Test extends Controller{
    function banksey(){
        $content_id = $this->uri->segment(3, 1);  //  The second parameter is the default value if the uri segment is not found
        ..do something here with $content_id
    }
}

As for staying on the same url, I am assuming your form is posting back to the same url you called in the first section. If not I would think about doing it that way. Its easier to display to initial page and deal with the form submission in the same controller. Otherwise you will have messy redirects or other work arounds.


Messages In This Thread
Show validation errors, well not today???? - by El Forum - 02-16-2010, 10:01 AM
Show validation errors, well not today???? - by El Forum - 02-16-2010, 10:12 AM
Show validation errors, well not today???? - by El Forum - 02-16-2010, 10:41 AM
Show validation errors, well not today???? - by El Forum - 02-16-2010, 12:16 PM
Show validation errors, well not today???? - by El Forum - 02-16-2010, 12:24 PM
Show validation errors, well not today???? - by El Forum - 02-18-2010, 10:58 AM
Show validation errors, well not today???? - by El Forum - 02-18-2010, 11:52 AM
Show validation errors, well not today???? - by El Forum - 02-18-2010, 12:37 PM
Show validation errors, well not today???? - by El Forum - 02-18-2010, 03:19 PM
Show validation errors, well not today???? - by El Forum - 02-18-2010, 04:07 PM
Show validation errors, well not today???? - by El Forum - 02-18-2010, 10:56 PM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 12:39 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 07:36 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 08:01 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 09:01 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 09:24 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 09:38 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 10:19 AM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 12:15 PM
Show validation errors, well not today???? - by El Forum - 02-19-2010, 11:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB