![]() |
URL Redirect Problem [Solved] - 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: URL Redirect Problem [Solved] (/showthread.php?tid=41106) |
URL Redirect Problem [Solved] - El Forum - 04-28-2011 [eluser]Ahmed Iqbal[/eluser] Hello, my url is look like 'http://www.domain.com/health/25105/best_medicine.html' Now im also use here one form to submit comments...! Please let me know, when i will submit my comment, url again redirect to 'http://www.domain.com/health/25105/best_medicine.html' current article...! well, by using 'redirect(current_url())' its move to form submit path not on current url path....! URL Redirect Problem [Solved] - El Forum - 04-28-2011 [eluser]michalsn[/eluser] This is normal behavior. You have at least 3 choices: - add hidden field to form with current_url() and use it to redirect - set flashdata before form submit to current_url and after submit redirect with this variable - use $_SERVER['HTTP_REFERER'] (but it isn't always a good idea) URL Redirect Problem [Solved] - El Forum - 04-28-2011 [eluser]Ahmed Iqbal[/eluser] Hello michalsn, First Thanks for your help...! "- add hidden field to form with current_url() and use it to redirect" very helpful in this case...! i used this ![]() take care have a good daye |