galvin Posted January 4, 2009 Share Posted January 4, 2009 Just curious if this is doable with PHP... I have a main page (we'll call it mainpage.php). On that page, there is a link that opens "newwindow.php" in a new window. There is a simple form on newwindow.php with an action of "mainpage.php". So when a user processes that form on newwindow.php, I want it to automatically CLOSE newwindow.php and essentially re-fresh mainpage.php in the original window (mainpage.php will have code to be run when the form from newwindow.php is submitted). Is this possible? (Right now it's just running mainpage.php in the "new window" so I then have two instances of mainpage.php open in two windows) Link to comment https://forums.phpfreaks.com/topic/139454-open-in-new-window-and-then-run-script-in-original-window/ Share on other sites More sharing options...
gevans Posted January 4, 2009 Share Posted January 4, 2009 This is all JavaScript, client side stuff, It can be done fairly simply. I don't have it off the top of my head. But you need to use TARGET with your form to point it at the parent page Link to comment https://forums.phpfreaks.com/topic/139454-open-in-new-window-and-then-run-script-in-original-window/#findComment-729476 Share on other sites More sharing options...
saradrungta Posted January 4, 2009 Share Posted January 4, 2009 <a href="newwindow.php" target ="_self" > use this i hope this 'll solve ur problem Link to comment https://forums.phpfreaks.com/topic/139454-open-in-new-window-and-then-run-script-in-original-window/#findComment-729480 Share on other sites More sharing options...
gevans Posted January 4, 2009 Share Posted January 4, 2009 @saradrungta I don't think that's what he was looknig for, it needs to be within the form and sending from one window to another Link to comment https://forums.phpfreaks.com/topic/139454-open-in-new-window-and-then-run-script-in-original-window/#findComment-729485 Share on other sites More sharing options...
galvin Posted January 4, 2009 Author Share Posted January 4, 2009 Yeah, saradrungta's would work if I wanted to do everything in the same window, but I NEED to open newwindow.php in a new window and then come back to the main window. I tried having a TARGET of "_parent" in the form in newwindow.php, but it still does NOT go back to the main window. I was hoping that simple change would do it, but no dice, so it sounds like javascript is probably required, like you said. Time to teach myself javascript Link to comment https://forums.phpfreaks.com/topic/139454-open-in-new-window-and-then-run-script-in-original-window/#findComment-729489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.