Form validation plugin result in 404 I'm new to craft development, and I'm on the verge of success in the creation of my plugin, but I have a strange problem.

It's supposed to save a record based on user input data. The problem is that it works on my computer, but not on my mobile phone (-> result in 404).

Here is the form

&lt;form class="ui form" method="POST"&gt;
    &lt;div class="field"&gt;
        &lt;label&gt;Activité&lt;/label&gt;
             &lt;select name="activity" class="ui fluid dropdown"&gt;
                 &lt;option value="3"&gt;Third&lt;/option&gt;
                 &lt;option value="2"&gt;Second&lt;/option&gt;
                 &lt;option value="1"&gt;First&lt;/option&gt;
             &lt;/select&gt;
         &lt;/div&gt;
         &lt;div class="field"&gt;
             &lt;label&gt;Nom et prénom&lt;/label&gt;
             &lt;input name="nom" type="text"&gt;
         &lt;/div&gt;

         &lt;input type="hidden" name="action" value="eventEquipe/event/addParticipant"&gt;
         &lt;button class="positive ui fluid button" type="submit"&gt;Je viens !&lt;/button&gt;
&lt;/form&gt;


Here is my controller's code
public function actionAddParticipant() {

$this-&gt;requirePostRequest();

    $participant        = new EventEquipe_ParticipantRecord();
    $request            = craft()-&gt;request;

    $participant-&gt;nom       = $request-&gt;getPost('nom');
    $participant-&gt;activity  = $request-&gt;getPost('activity');

    craft()-&gt;eventEquipe_event-&gt;saveParticipant($participant);
    $this-&gt;redirect('/agenda');
}


The problem is that sometimes, this redirects me to /login (I dont know why, I have no /login route) and thus result in a 404.

Thanks for your help !
Sounds like you need to allow anonymous access to your controller action.

I guess it works on your computer because you are logged in and thus have a valid session, but then when you try on mobile, you haven't got a valid session, your controller isn't set up to allow logged out users to post to it and therefore you get redirected to /login

To allow non logged in users access to this action, its simple. Add either one of these just at the top within your controller class.

// Will allow anonymous access to all actions within this controller
protected $allowAnonymous = true;

// Only allow access to specific actions
protected $allowAnonymous = array('action addParticipant');