So I am using Limonade PHP which has a RESTful design which emulates PUT, POST, DELETE routes for create, update, delete.
I am trying to develop some form validation which is going well. The major problem I am facing though is how to return my filtered data (which has failed validation) back to repopulate the create or edit form.
How would this be done? I currently have for creating a page:
/admin/page/new -> GET function
/admin/page -> POST function
+ validate
+ pass, update db
+ fail, add errors to flash, redirect to /admin/page/mew
It all falls down as I do not know how to populate the /admin/page/new with the invalid, but filtered data.
Have you used a session to carry the data to /admin/page/new?
http://www.php.net/manual/en/session.examples.basic.php
edit:
I just found this article: http://www.recessframework.org/page/towards-restful-php-5-basic-tips which recommends using a cookie over $_SESSION. It doesn’t elaborate on why, but either one will achieve the result you want.