Revert "Rewrite save.php"

This reverts commit 766f56d9444cc2b8f35776e93e7bd895cad42396.