• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changing the route

#1
I have added the following route:
$route['save_userinput']='Users/save_userinput';

My idea was that in a form when I have 
<form name ="userinput" action="save_userinput" method="post">

would actually run the method save_userinput() in the Users class. 





But this does not seems to work. Is it possible to use route to change the "action" of a form? I found an example online which shows <form action="/action_page.php" method="get"> as sending the form to action_page.php. But CI doesn't work like this. So is it possible to send a form to a method in a class? 
Reply

#2
You are missing the slash ("/") at the beginning ot your href link.
As you have it, it will reference "save_userinput" relative to the current page/folder, which is not likely to match a routing rule. You can see what it gives a 404 error for by checking your apache access log.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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