Welcome Guest, Not a member yet? Register   Sign In
Page Redirection Problem
#1

[eluser]thinzar[/eluser]
hi all,
i used to get this page redirection problem.

An Error Was Encountered
Unable to load the requested file: admin/admin_importsuccess.php


while in my code, i redirect this way
Code:
//some file upload codes
//some sql insert codes

$this->load->view('admin/admin_importsuccess', $data);

I get this problem after text file import to server. It redirected fine in my localhost. But got error after the project is deployed. Can anyone plz suggest what is wrong? Thanks in advance.
#2

[eluser]gtech[/eluser]
not a lot to go on.. does the file admin_importsuccess.php exist in views/admin/ ?
#3

[eluser]thinzar[/eluser]
[quote author="gtech" date="1210337462"]not a lot to go on.. does the file admin_importsuccess.php exist in views/admin/ ?[/quote]
yeah.. it does exists. It also exists on server's folder. This is the second time I face this loading view problem. Last time, I just stop there without redirecting. Any more suggestion plz.. thanks
#4

[eluser]meridimus[/eluser]
Ok, am I right in thinking that you're trying to redirect the user straight after seeing a success message? If so...

Instead, load the url helper

Code:
$this->load->helper("url");

Then you can redirect users like so (in your controller, instead of loading a view):

Code:
redirect("your/desire/location");

Make sure that redirect is used before anything gets written to the page!

What I do, is if for example you're sending a user to a list of news posts after they've posted a news post. You could do /news/view/40 and then highlight the newly added news post with an additional css style, rather than showing a success message.




Theme © iAndrew 2016 - Forum software by © MyBB