let's say that we are on
somesite.com/mail
this means that we are using a controller named "mail". This controller has the function:
public function index(){ $this->load->view('header'); $this->load->view('mail/contact_form'); $this->load->view('footer'); }
This function loads when we enter the address bar only
somesite.com/mail
and press enter (no additional arguments). And look at the first line of the form contact_form:
<form role="form" method="post" action="sendmail">
And that is my problem. When I type the address with a backslash at the end, for example:
mysite.com/mail/
and use my contact formula, everything works fine, and my Mail controller loads the sendmail function, and now the URL:
mysite.com/mail/sendmail/
But when I forget about the backslash (mysite.com/mail), it searches for a controller named "sendmail", but I don't want that. Then my url:
mysite.com/sendmail
but of course I don't have controllers named sendmail. My question is: how do I change the action of my formula or what should I do to make this work well? Is this the only answer you need to remember about the backslash or what?
source share