Hi Kanchi,
A basic question about what you are trying to do..
What is the logic for the iframe? (Probably, there is a more straightforward way to peel the chicken, skin the cat and roast a porksteak)
Anyway.. You probably want to keep the target at the main.php. However, whenever you load the main page, you keep in mind (You make sure the website does this) which content was loaded in the iframe, so when it reloads, you can place the same content there. THat is what Azala referred to. Using a session.
Basically, a session is a semi-permanent storagebox for your website. You can place variables & their value into the session, and retrieve it when the next page loads. IF you are going to go down that lane, I agree that you should read up on them first, since it requires some background knowledge, otherwise you will get stuck with them, further down.
But as I said in the beginning: Probably you can do this in a more efficient way. (I have not come across many sites where an Iframa had to be used...)