Re: send POST data to a controller cause a 404!

2011-08-23 Thread WebbedIT
Better where possible to disable the ajax fields rather than turn off
security validation for the whole form.

HTH, Paul

On Aug 22, 1:28 pm, Sepehr Laal 3pehr.l...@gmail.com wrote:
 tnx :D

 On Mon, Aug 22, 2011 at 12:30 PM, O.J. Tibi ojt...@gmail.com wrote:
  Or you can those fields that you want to add/remove by JavaScript in
  `$this-Security-disabledFields` as suggested by WebbedIT. :)

   --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
  athttp://groups.google.com/group/cake-php

 --
 **
 *

 
 *

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-23 Thread Sepehr Laal
tnx :D

On Tue, Aug 23, 2011 at 1:35 PM, WebbedIT p...@webbedit.co.uk wrote:

 Better where possible to disable the ajax fields rather than turn off
 security validation for the whole form.

 HTH, Paul

 On Aug 22, 1:28 pm, Sepehr Laal 3pehr.l...@gmail.com wrote:
  tnx :D
 
  On Mon, Aug 22, 2011 at 12:30 PM, O.J. Tibi ojt...@gmail.com wrote:
   Or you can those fields that you want to add/remove by JavaScript in
   `$this-Security-disabledFields` as suggested by WebbedIT. :)
 
--
   Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
   others with their CakePHP related questions.
 
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this
 group
   athttp://groups.google.com/group/cake-php
 
  --
  **
  *
 
  
  *

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
**
*


*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-22 Thread WebbedIT
Do you have any fields added or removed from this form after the page
is rendered?

If so, this will invalidate the security token.  The answer to that
problem is to add those fields into $this-Security-disabledFields so
it does not include them in the security validation process.

HTH, Paul.

On Aug 21, 9:06 pm, Sepehr Laal 3pehr.l...@gmail.com wrote:
 yes, i've enabled the security component. something interesting! when I
 delete [_token][fields] and [_token][key] it won't throw a 404 so I think
 the main problem is from these security stuff.

 On Mon, Aug 22, 2011 at 12:27 AM, Tilen Majerle 
 tilen.maje...@gmail.comwrote:









  ok, check form action,
  have you enabled Security component...?...this could be a problem

  --
  Lep pozdrav, Tilen Majerle
 http://majerle.eu

  2011/8/21 Sepehr Laal 3pehr.l...@gmail.com

  yeah but you do know that this doesn't make a different!

  On Sun, Aug 21, 2011 at 11:53 PM, Tilen Majerle 
  tilen.maje...@gmail.comwrote:

  controller method should be underscored, so test_p_o_s_t or idk:
  test_post
  --
  Lep pozdrav, Tilen Majerle
 http://majerle.eu

  2011/8/21 3p3r 3pehr.l...@gmail.com

   Hi all.
  I have a no Model/View controller and i'm trying to send data to it
  from a form with POST method. the form is not editable cuz it's not
  mine. it's in another website. when I navigate to this public function
  via URL, everything is fine. but when I try to send data to it, it'll
  give me a 404 error. anyone knows how to deal with this issue?
  here is the form:
  
  form accept-charset=utf-8 method=post action=/remitments/
  testPOST
  ... some inputs
  /form
  

  and here is the controller function:
  
  function testPOST()
  {
         $this-disableCache();
         $this-layout = 'none';
         $this-autoRender = false;
         echo pre;
         print_r($_POST);
         echo /pre;
  }
  

  --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
  help others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this
  group athttp://groups.google.com/group/cake-php

   --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
  athttp://groups.google.com/group/cake-php

  --
  **
  *

  
  *

   --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
  athttp://groups.google.com/group/cake-php

   --
  Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
  others with their CakePHP related questions.

  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group
  athttp://groups.google.com/group/cake-php

 --
 **
 *

 
 *

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-22 Thread Sepehr Laal
Thanks a lot! this worked! thanks. by the way, just ask'in, is it safe to
remove those fields via javascript in clientside?

On Mon, Aug 22, 2011 at 11:00 AM, WebbedIT p...@webbedit.co.uk wrote:

 Do you have any fields added or removed from this form after the page
 is rendered?

 If so, this will invalidate the security token.  The answer to that
 problem is to add those fields into $this-Security-disabledFields so
 it does not include them in the security validation process.

 HTH, Paul.

 On Aug 21, 9:06 pm, Sepehr Laal 3pehr.l...@gmail.com wrote:
  yes, i've enabled the security component. something interesting! when I
  delete [_token][fields] and [_token][key] it won't throw a 404 so I think
  the main problem is from these security stuff.
 
  On Mon, Aug 22, 2011 at 12:27 AM, Tilen Majerle tilen.maje...@gmail.com
 wrote:
 
 
 
 
 
 
 
 
 
   ok, check form action,
   have you enabled Security component...?...this could be a problem
 
   --
   Lep pozdrav, Tilen Majerle
  http://majerle.eu
 
   2011/8/21 Sepehr Laal 3pehr.l...@gmail.com
 
   yeah but you do know that this doesn't make a different!
 
   On Sun, Aug 21, 2011 at 11:53 PM, Tilen Majerle 
 tilen.maje...@gmail.comwrote:
 
   controller method should be underscored, so test_p_o_s_t or idk:
   test_post
   --
   Lep pozdrav, Tilen Majerle
  http://majerle.eu
 
   2011/8/21 3p3r 3pehr.l...@gmail.com
 
Hi all.
   I have a no Model/View controller and i'm trying to send data to it
   from a form with POST method. the form is not editable cuz it's not
   mine. it's in another website. when I navigate to this public
 function
   via URL, everything is fine. but when I try to send data to it,
 it'll
   give me a 404 error. anyone knows how to deal with this issue?
   here is the form:
   
   form accept-charset=utf-8 method=post action=/remitments/
   testPOST
   ... some inputs
   /form
   
 
   and here is the controller function:
   
   function testPOST()
   {
  $this-disableCache();
  $this-layout = 'none';
  $this-autoRender = false;
  echo pre;
  print_r($_POST);
  echo /pre;
   }
   
 
   --
   Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
   help others with their CakePHP related questions.
 
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this
   group athttp://groups.google.com/group/cake-php
 
--
   Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd
 help
   others with their CakePHP related questions.
 
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this
 group
   athttp://groups.google.com/group/cake-php
 
   --
   **
   *
 
   
   *
 
--
   Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
   others with their CakePHP related questions.
 
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this
 group
   athttp://groups.google.com/group/cake-php
 
--
   Our newest site for the community: CakePHP Video Tutorials
  http://tv.cakephp.org
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
   others with their CakePHP related questions.
 
   To unsubscribe from this group, send email to
   cake-php+unsubscr...@googlegroups.com For more options, visit this
 group
   athttp://groups.google.com/group/cake-php
 
  --
  **
  *
 
  
  *

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
**
*


*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For 

Re: send POST data to a controller cause a 404!

2011-08-22 Thread O.J. Tibi
Hi 3p3r,

Yes, you can safely add/remove fields in the form BUT only if you set 
`$this-Security-validatePost = false` on top of the action that will 
receive your form data.

Cheers,
OJ

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-22 Thread O.J. Tibi
Or you can those fields that you want to add/remove by JavaScript in 
`$this-Security-disabledFields` as suggested by WebbedIT. :)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-22 Thread Sepehr Laal
tnx :D

On Mon, Aug 22, 2011 at 12:30 PM, O.J. Tibi ojt...@gmail.com wrote:

 Or you can those fields that you want to add/remove by JavaScript in
 `$this-Security-disabledFields` as suggested by WebbedIT. :)

  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
**
*


*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


send POST data to a controller cause a 404!

2011-08-21 Thread 3p3r
Hi all.
I have a no Model/View controller and i'm trying to send data to it
from a form with POST method. the form is not editable cuz it's not
mine. it's in another website. when I navigate to this public function
via URL, everything is fine. but when I try to send data to it, it'll
give me a 404 error. anyone knows how to deal with this issue?
here is the form:

form accept-charset=utf-8 method=post action=/remitments/
testPOST
... some inputs
/form


and here is the controller function:

function testPOST()
{
$this-disableCache();
$this-layout = 'none';
$this-autoRender = false;
echo pre;
print_r($_POST);
echo /pre;
}


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-21 Thread Tilen Majerle
controller method should be underscored, so test_p_o_s_t or idk: test_post
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/8/21 3p3r 3pehr.l...@gmail.com

 Hi all.
 I have a no Model/View controller and i'm trying to send data to it
 from a form with POST method. the form is not editable cuz it's not
 mine. it's in another website. when I navigate to this public function
 via URL, everything is fine. but when I try to send data to it, it'll
 give me a 404 error. anyone knows how to deal with this issue?
 here is the form:
 
 form accept-charset=utf-8 method=post action=/remitments/
 testPOST
 ... some inputs
 /form
 

 and here is the controller function:
 
 function testPOST()
 {
$this-disableCache();
$this-layout = 'none';
$this-autoRender = false;
echo pre;
print_r($_POST);
echo /pre;
 }
 

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-21 Thread Sepehr Laal
yeah but you do know that this doesn't make a different!

On Sun, Aug 21, 2011 at 11:53 PM, Tilen Majerle tilen.maje...@gmail.comwrote:

 controller method should be underscored, so test_p_o_s_t or idk: test_post
 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2011/8/21 3p3r 3pehr.l...@gmail.com

 Hi all.
 I have a no Model/View controller and i'm trying to send data to it
 from a form with POST method. the form is not editable cuz it's not
 mine. it's in another website. when I navigate to this public function
 via URL, everything is fine. but when I try to send data to it, it'll
 give me a 404 error. anyone knows how to deal with this issue?
 here is the form:
 
 form accept-charset=utf-8 method=post action=/remitments/
 testPOST
 ... some inputs
 /form
 

 and here is the controller function:
 
 function testPOST()
 {
$this-disableCache();
$this-layout = 'none';
$this-autoRender = false;
echo pre;
print_r($_POST);
echo /pre;
 }
 

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
**
*


*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-21 Thread Tilen Majerle
ok, check form action,
have you enabled Security component...?...this could be a problem

--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2011/8/21 Sepehr Laal 3pehr.l...@gmail.com

 yeah but you do know that this doesn't make a different!

 On Sun, Aug 21, 2011 at 11:53 PM, Tilen Majerle 
 tilen.maje...@gmail.comwrote:

 controller method should be underscored, so test_p_o_s_t or idk: test_post
 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2011/8/21 3p3r 3pehr.l...@gmail.com

  Hi all.
 I have a no Model/View controller and i'm trying to send data to it
 from a form with POST method. the form is not editable cuz it's not
 mine. it's in another website. when I navigate to this public function
 via URL, everything is fine. but when I try to send data to it, it'll
 give me a 404 error. anyone knows how to deal with this issue?
 here is the form:
 
 form accept-charset=utf-8 method=post action=/remitments/
 testPOST
 ... some inputs
 /form
 

 and here is the controller function:
 
 function testPOST()
 {
$this-disableCache();
$this-layout = 'none';
$this-autoRender = false;
echo pre;
print_r($_POST);
echo /pre;
 }
 

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




 --
 **
 *

 
 *

  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: send POST data to a controller cause a 404!

2011-08-21 Thread Sepehr Laal
yes, i've enabled the security component. something interesting! when I
delete [_token][fields] and [_token][key] it won't throw a 404 so I think
the main problem is from these security stuff.

On Mon, Aug 22, 2011 at 12:27 AM, Tilen Majerle tilen.maje...@gmail.comwrote:

 ok, check form action,
 have you enabled Security component...?...this could be a problem

 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2011/8/21 Sepehr Laal 3pehr.l...@gmail.com

 yeah but you do know that this doesn't make a different!

 On Sun, Aug 21, 2011 at 11:53 PM, Tilen Majerle 
 tilen.maje...@gmail.comwrote:

 controller method should be underscored, so test_p_o_s_t or idk:
 test_post
 --
 Lep pozdrav, Tilen Majerle
 http://majerle.eu



 2011/8/21 3p3r 3pehr.l...@gmail.com

  Hi all.
 I have a no Model/View controller and i'm trying to send data to it
 from a form with POST method. the form is not editable cuz it's not
 mine. it's in another website. when I navigate to this public function
 via URL, everything is fine. but when I try to send data to it, it'll
 give me a 404 error. anyone knows how to deal with this issue?
 here is the form:
 
 form accept-charset=utf-8 method=post action=/remitments/
 testPOST
 ... some inputs
 /form
 

 and here is the controller function:
 
 function testPOST()
 {
$this-disableCache();
$this-layout = 'none';
$this-autoRender = false;
echo pre;
print_r($_POST);
echo /pre;
 }
 

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and
 help others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this
 group at http://groups.google.com/group/cake-php


  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




 --
 **
 *

 
 *

  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php


  --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group
 at http://groups.google.com/group/cake-php




-- 
**
*


*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php