open new window and after closing automaticaly refresh tha previous page


plz help me
i want that when i click on any link on some page containing records form database,without going to that link/page it will open a new window containing form for some data entry and when i click submit it will add the record to database and then close automatically. after that previous page will refresh and show all the records