zota Posted March 11, 2016 Posted March 11, 2016 Hi! The following code does this:(a) $p survives to the test, (never echoes "stupid!") so (b) resend $p->textJSon, (believing on the browser's client side console) BUT ( c) does not save $value to $p->textJSon (both reload and back side prove it) The puzzle: how can (b) and © been compatible? Thanks(btw: $p should not be necessary, as I post to "./". So $page should be enough, right? But result was exactly - or looks - the same) <?php if($config->ajax) { $value = json_decode(file_get_contents('php://input')); $p = $pages->get("/hot/"); if (!($p instanceof NullPage)) { $p->of(false); $p->textJSon = $value; echo json_encode($p->textJSon, JSON_UNESCAPED_UNICODE) ; } else { echo 'stupid!' ; } return; } else { ... include head, foot, and so...
adrian Posted March 11, 2016 Posted March 11, 2016 You don't appear to be saving the page anywhere, so do this: $p->save('textJSon'); after you set the $value 1
zota Posted March 11, 2016 Author Posted March 11, 2016 Tx Adrian, besides the save, there was another json_encode bug
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now