Converting edit.php to work with ajax