CodeIgniter Forums
redirect problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: redirect problem (/showthread.php?tid=31755)



redirect problem - El Forum - 06-30-2010

[eluser]hamzakhan[/eluser]
my url
http://localhost/server/connectionspot/admin/geographic/region/?lang=ch

when i click submit to add region using this code
form_open("http://localhost/server/connectionspot/admin/geographic/region/add");

after clicking my url look like
http://localhost/server/connectionspot/admin/regions/?lang=ch

which is invalid path to add regions

please tell me where i am going wrong??


redirect problem - El Forum - 06-30-2010

[eluser]TheIgniter[/eluser]
I dont understund, you to be redirected after the submit?
first try to change the url of your form_open :
try :
Code:
form_open(“geographic/region/add”);
or
Code:
form_open(“region/add”);



redirect problem - El Forum - 06-30-2010

[eluser]ndchris[/eluser]
Like TheIgniter I don't really get it too.

But according to the User Guide the form_open() method creates a form tag based on your url settings from your config preferences. And you just have to pass the right controller and method, probably like:
Code:
echo form_open('admin/geographic/region/add');



redirect problem - El Forum - 06-30-2010

[eluser]hamzakhan[/eluser]
echo form_open('admin/geographic/region/add');
this is my form open link and when i submit the
form using this url.
automatically url change like
admin/region/

geographic automatically removed from url.


redirect problem - El Forum - 06-30-2010

[eluser]WanWizard[/eluser]
If you are sure that the form contains the correct action URL, there are a few options:
- a mod_rewrite issue
- a redirect in the code
- a defined route (alhough that shouldn't change the URL?)

Redirects happen for a reason.

Set the 'log_threshold' to 4, and try to add some logging in strategic places using
Code:
log_message('DEBUG', 'We are now here and this has happened');
You can then check the logfile for anomalies.