Welcome Guest, Not a member yet? Register   Sign In
Any One who can give a way to this.....
#1

[eluser]zombica[/eluser]
I am creating a DB driven web portal. The problem i am facing is that once i insert a record and after insertion if i bring it to the same view page from where the whole data of the form was posted and refreshes page again. Browser ask me to weather refresh the page "yes" or "no", and i f i presses yes it actually insert another record behind the scene. Whats the real fact behind that. I m using MVC approach how could be this thing possible in MVC.

Am i lacking some thing in my application.


Thanx in advance......

Regards,
Zombica
#2

[eluser]Thorpe Obazee[/eluser]
That's normal(not only for CI applications). There's post regarding this. You can use the search function.
#3

[eluser]zombica[/eluser]
Hmmmm sorry but i couldn't understand how is it possible that you insert the record twice say if inserted a record once and i press prev button it must not insert the next record on again submitting the page form.

Please Help me in this it's getting rusty for me now.


Thanx....
Regards,
Zombica.
#4

[eluser]Thorpe Obazee[/eluser]
[quote author="zombica" date="1246282639"]I am creating a DB driven web portal. The problem i am facing is that once i insert a record and after insertion if i bring it to the same view page from where the whole data of the form was posted and refreshes page again. Browser ask me to weather refresh the page "yes" or "no", and i f i presses yes it actually insert another record behind the scene. Whats the real fact behind that. I m using MVC approach how could be this thing possible in MVC.

Am i lacking some thing in my application.


Thanx in advance......

Regards,
Zombica[/quote]

When you submit a form it inserts a record....

refreshing it and re-submitting it inserts it again...

Nothing trivial here.

Search produced a few topics:

http://ellislab.com/forums/viewthread/112638/
http://ellislab.com/forums/viewthread/97534/
http://ellislab.com/forums/viewthread/63733/
http://ellislab.com/forums/viewthread/119291/
#5

[eluser]zombica[/eluser]
In latest modern techniques when you are using controller actions it must not keep user data history with it self.

Say if i insert a record on adduser.php post that data, insert it through controller and after insertion move it to another userslistview.php page there if i presses the prev button or refreshes the page there it must not keep my previous user history data. if it keeps that data it will make another insertion which is not agood thing.

I hope you undesrtand what i am asking for..
Thanx for your cooperation.

Regards,
Zombica.
#6

[eluser]Thorpe Obazee[/eluser]
Did you try searching the forums? Did you try the threads I searched especially for you?

http://ellislab.com/forums/viewthread/119291/
#7

[eluser]zombica[/eluser]
Yeah i have looked for the threads you have given me i will try the techniques given on these threads still some thing is questionable? Is there any way if user presses back button all the data which was posted must be flushed out.

If this could be possible then i must got my solution in a near chance.

Thanks......
Regards,
Zombica
#8

[eluser]Thorpe Obazee[/eluser]
http://ellislab.com/forums/viewthread/119291/
#9

[eluser]zombica[/eluser]
Any specific details for this if i used this in my code.....

$this->output->set_header('Cache: No-cache');


Thanks.....
Regards,
Zombica




Theme © iAndrew 2016 - Forum software by © MyBB