combined read.php and write.php