CakePHP 2.5.4: Redirect URL after submitting a form

I want to submit the form www.example.com/users/signup , but my page is sent to www.example.com/test/users/signup , Cakephp is installed in the test folder. I created htaccess inside the test folder. This is my htaccess:

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteRule    ^$ test/    [L]
 RewriteRule    (.*) test/$1 [L]
 RewriteRule    ^$ /test/users/signup  [L]
 RewriteRule users/signup /users/signup [L]
</IfModule>

View:

<?php 
echo $this->Form->create('User',array('url'=>array('controller'=>'users','action'=>'signup')), array('id' => 'signup',  'role' => 'form','class'=>'form-signin')); 

echo $this->Form->input('User.email',array('type'=>'email','required'=>'required','class'=>'form-control','placeholder'=>'Email'));

echo $this->Form->input('User.password',array('type'=>'password','required'=>'required','class'=>'form-control','placeholder'=>'Password'));
?>

<button type="submit" class="btn btn-lg btn-primary btn-block">Sign up</button>
<?php echo $this -> Form -> end(); ?>

I created routes:

<?php

Router::connect('/users/signup', array('controller' => 'users', 'action' => 'signup'));
?>

If you want to ask any request, feel free to ask.

+1
source share
1 answer

/signup - , route.php - " url", /{controller}/{action}. , , $this- > Form- > create() POSTs/signup. , /signup, URL- . , , , . Configure:: write ('App.baseUrl,'/'); .

: Configure:: write ('App.baseUrl,'/');

+1

All Articles