[fw-general] POSTDATA problem

2009-08-06 Thread nickt66

I have this scenario

Page A
- Gathers data from user in form.
- It POSTS data to Page B

Page B
- Writes POST data to db
- Displays POST data

The problem is if the user goes from Page A -> Page B -> Page C (back
button) -> Page B then when they go back to Page B the POST data gets
written to the db again. Aside from the inefficiency, this is a problem
because stats are being incremented each time. So the data is being made
invalid by the user backing through Page B.

I tried solving it like this:

Page A
- Gathers data from user in form.
- It POSTS data to Page Z

Page Z
- Writes POST data to db
- Redirects to Page B

Page B
- Displays the POST data

This works great in the sense that going from C back to B back to A doesn't
break the db data because Page Z is never hit again. 

But here's the problem - I need to POST the data from Page Z to Page B so
that it can display the data. The data in question is an array of JSON data. 

I tried using Zend_Http_Client and POST but that doesn't cause a redirect
from Z to B. Instead I get an error with the framework complaining it can't
find a view for Page Z (because of course, there isn't supposed to be one).

So, if I'm in a controller action handler, how do I redirect to another
action handler and POST data to that handler?

Thanks

Nick
-- 
View this message in context: 
http://www.nabble.com/POSTDATA-problem-tp24859040p24859040.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Filter_Input problem in Zend Framework 1.9

2009-08-06 Thread nickt66

I've run into a problem with Zend_FIlter_Input and the ZF1.9 release. I have
various controller actions that start by doing something like this:

$input =  new Zend_Filter_Input(array('lesson' => 'digits'), array('lesson'
=> 'int'), $this->getRequest()->getUserParams()); 

and then go on to use retrieved params like this: $input->lesson 

This code has worked fine on various versions of the Framework up until 1.9.
Now, on 1.9 running on Production (PHP 5.2.1) $input->lesson is NULL. 

If I dump out $input, the debug output is identical under 1.8 and 1.9. (see
below for output). And in either case I can see the correct value for
lesson. But when I retrieve it, as above, I get NULL.

Even more curiously, the code continues to work fine with 1.9 on my
development machine (OS X 10.4.11, PHP 5.2.4).

Obviously it is a show stopper for me as none of my controller actions can
retrieve URL params any more! I'm a newbie, so this kind of system specific
problem has me scratching my head.

Nick

DUMP OUTPUT

object(Zend_Filter_Input)#58 (12) {
  ["_data:protected"] => array(4) {
["controller"] => string(6) "lesson"
["action"] => string(6) "browse"
["lesson"] => string(2) "44"
["module"] => string(7) "default"
  }
  ["_filterRules:protected"] => array(1) {
["lesson"] => string(6) "digits"
  }
  ["_validatorRules:protected"] => array(1) {
["lesson"] => string(3) "int"
  }
  ["_validFields:protected"] => array(0) {
  }
  ["_invalidMessages:protected"] => array(0) {
  }
  ["_invalidErrors:protected"] => array(0) {
  }
  ["_missingFields:protected"] => array(0) {
  }
  ["_unknownFields:protected"] => array(0) {
  }
  ["_defaultEscapeFilter:protected"] => NULL
  ["_loaders:protected"] => array(0) {
  }
  ["_defaults:protected"] => array(6) {
["allowEmpty"] => bool(false)
["breakChainOnFailure"] => bool(false)
["escapeFilter"] => string(12) "HtmlEntities"
["missingMessage"] => string(70) "Field '%field%' is required by rule
'%rule%', but the field is missing"
["notEmptyMessage"] => string(51) "You must give a non-empty value for
field '%field%'"
["presence"] => string(8) "optional"
  }
  ["_processed:protected"] => bool(false)
}
-- 
View this message in context: 
http://www.nabble.com/Zend_Filter_Input-problem-in-Zend-Framework-1.9-tp24853238p24853238.html
Sent from the Zend Framework mailing list archive at Nabble.com.