0

Possible Duplicate:
keep browser from resending post variables

When I try to load a view after some processing is done, the URL doesn't change and If user accidentally refresh the page he will resend the request and it will be processed all again.

I load a view and I pass some data to it. So I can't use redirect. How can I solve this problem?

 $data['message'] = 'value1'; $data['another_message'] = 'value2'; $this->load->view('my_view', $data); 
5
  • Please paste your code!!!!!!!!!!!!!!!! Commented Jan 19, 2013 at 17:07
  • @tereško Thanks for your time. In those answers it is mentioned to redirect but as I stated before I can't use redirect() because I want to pass some data to the view. Commented Jan 19, 2013 at 17:15
  • @mamdouhalramadan Thanks, but It's a bit long. I edited my Question and added how I load the view. Commented Jan 19, 2013 at 17:19
  • @Zim3r - this is not enough to see what's going on, at all. Commented Jan 19, 2013 at 17:25
  • fun fact: you can use $_SESSION to store the data between requests Commented Jan 19, 2013 at 17:56

1 Answer 1

1

You need to use the POST/REDIRECT/GET pattern for this.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks but I still can't use this. first of all because I want to load a view instead of using redirect.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.