I have a project where users have their own user pages which consists of blocks which are editable (they can be moved around and their content can be changed). Content of these blocks (currently mostly text) etc. are stored in a mysql database. Whole editing is done by mypage-editing.js
script. After user saves the changes he has done page-editing.js
sends an ajax post call to save-page.php
(data is an array of block objects, username and page name) which inserts received data to mysql database.
My questions is:
How can I prevent "inappropriate" post calls to my save-page.php
, because as far as I know anyone can send calls to it. Will it be enough if in save-page.php
I check that login sessions has started an session has right username in it?