in reply to saving data problem
Could you be a bit more specific about what problem you are having? Do you have any error messages?
Is writing to the file causing the problems? If so then I would suspect a permissions problem. CGI scripts tend not to run with your user id but as processes belonging to another user (often 'nobody'), so you have to make sure that this user has permission to write to your file.