• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
url after using a function

#1
[eluser]poopants[/eluser]
Hi everyone,

I have a small question regarding URL's. I'm justing toying around with CI
and I like it a lot Smile I'm experimenting with a CRUD for an items table.

After following a tutorial online, (and some browsing in the User Guide and Forum)
I managed to get it working.

When I click my add button, the form (I filled in) is captured by the controller, nicely
fed to the models which does the mysql stuff.

However ... after adding an item, my url stays at : <controller>/add
This didn't bother me until I reloaded the page, and noticed the selected item was added
another time.

Probably I'm overlooking some tiny details, but can anyone point out for me where my problem is ?

Many thanks in advance

grtz
PP

#2
[eluser]poopants[/eluser]
Hmm ... seems like I have found a solution
for it, when looking at other tutorials ... Smile

As last rule of my add function, I added :
redirect('list);

(which is the name of the controller)

This seems to do the trick Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.