Welcome Guest, Not a member yet? Register   Sign In
Controller runs its constructor again after POST
#1

[eluser]bolts25[/eluser]
New to CodeIgniter and seeking some high level guidance.

I have a simple application. A controller, a model (MySQL based) and a View.

Everything is fine until the first POST. The controller restarts - it runs the controller constructor again.

Is this normal behaviour? Is this how CodeIgniter is supposed to work?

Thanks in advance.

#2

[eluser]joergy[/eluser]
What params You have given to form_open()?
#3

[eluser]bolts25[/eluser]
I did not use the form_open() function. I just used the <form> tags in the view.
#4

[eluser]joergy[/eluser]
Ok, and what action did You specify?
#5

[eluser]Otemu[/eluser]
Paste your code be easier for us to try find whats wrong
#6

[eluser]bolts25[/eluser]
Here is the code:

Code:
<form acti echo site_url() . "/ctl_members/filtered"?>" method="post">
#7

[eluser]bolts25[/eluser]
Let me try that again .....


Code:
<form acti echo site_url() . "/ctl_members/filtered"?>" method="post">
#8

[eluser]bolts25[/eluser]
For some reason, my code is being modified when I upload it.

Code contains:

form action=url method=post


#9

[eluser]CroNiX[/eluser]
Are you sure there aren't any 404 errors when loading that page, like a missing image or something? Use the browsers developer tools/network tab to check. View the page source and look at your form open tag. Does it look correct? It looks like it might have an extra / the way you wrote it.
#10

[eluser]joergy[/eluser]
if "ctl_members" is Your controller and "filtered" the method in the controller, then it is absolutely normal, that the CTOR of the controller "ctl_members" is called.

therefor:

"Is this normal behavior?" => yes
"Is this how CodeIgniter is supposed to work?" => yes




Theme © iAndrew 2016 - Forum software by © MyBB