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
<form class="ui form" method="POST">
<div class="field">
<label>Activité</label>
<select name="activity" class="ui fluid dropdown">
<option value="3">Third</option>
<option value="2">Second</option>
<option value="1">First</option>
</select>
</div>
<div class="field">
<label>Nom et prénom</label>
<input name="nom" type="text">
</div>
<input type="hidden" name="action" value="eventEquipe/event/addParticipant">
<button class="positive ui fluid button" type="submit">Je viens !</button>
</form>
Here is my controller's code public function actionAddParticipant() {
$this->requirePostRequest();
$participant = new EventEquipe_ParticipantRecord();
$request = craft()->request;
$participant->nom = $request->getPost('nom');
$participant->activity = $request->getPost('activity');
craft()->eventEquipe_event->saveParticipant($participant);
$this->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 !