CodeIgniter Forums
[solved]Function URL issue? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [solved]Function URL issue? (/showthread.php?tid=44005)



[solved]Function URL issue? - El Forum - 07-30-2011

[eluser]brucebat[/eluser]
Hello everyone:

Im having a slight problem with my urls in the sense that if I was to refresh the page all my functions will get re-executed which means data will get duplicated in the database etc.

This is my url:

http:://localhost/midas/site/submit/submitform

However this loads a "Success" view page where it says the user has submitted the data succesfully. If you refresh the page it executes functions "submitform".


I tried loading another function within my submitform function called "success" however the URL does not change.

So really I want something like this:

http:://localhost/midas/site/submit/success

Any suggestions how to fix this?

I tried using redirect however this breaks my page as I am passing data to my success view. I get undefined variable.

Thanks


[solved]Function URL issue? - El Forum - 07-31-2011

[eluser]isawhat[/eluser]
You could do the redirect and use the flashdata in the sessions class to pass the data you need to display in the view.


[solved]Function URL issue? - El Forum - 07-31-2011

[eluser]brucebat[/eluser]
Thanks that fixed it! Smile