I study php, there was a problem. I use the phalcon framework, I make the user registration window using the view & controllers. The problem occurs when moving from the start page to the registration page. If you intentionally make a typo in the code, the registration page is shown (along with errors), if you write the code correctly, then the registration page is not shown at all, the link does not translate to registration, but again shows the start page. What is the problem? Maybe I didn’t properly configure the server? registration form with an error in the code registration form without error code

UPD: Here is the code for the IndexController.php controller:

<?php use Phalcon\Mvc\Controller; class IndexController extends Controller { public function indexAction() { //echo '<h1>Hello!</h1>'; } } 

And the code of the SignupController.php controller:

 <?php use Phalcon\Mvc\Controller; class SignupController extends Controller { public function indexAction() { } public function registerAction() { $user = new Users(); // Store and check for errors $success = $user->save( $this->request->getPost(), [ "name", "email", ] ); if ($success) { echo "Thanks for registering!"; } else { echo "Sorry, the following problems were generated: "; $messages = $user->getMessages(); foreach ($messages as $message) { echo $message->getMessage(), "<br/>"; } } $this->view->disable(); } } 

I do not have the .htaccess file, I use NGINX

  • 3
    code in the studio. Controller, .htaccess, routing. - Mikhail Rebrov

1 answer 1

Found a solution to the problem. In the /tutorial.dev/app/view folder I had this: signup index.phtml

And there should have been 2 folders: signup index

Each of them contains the corresponding index.phtml. I have the start page all the time, because I did not place its index.phtml in the folder.