Awanka Posted July 11, 2007 Share Posted July 11, 2007 I have a php popup window that I want to do 2 things. I want it to call the php script campExport.php and also close itself at the same time. Can anyone help me? =============== echo "<SCRIPT LANGUAGE=\"JavaScript\"> window.close();</script>"; header('location:campExport.php'); Quote Link to comment Share on other sites More sharing options...
pedrobcabral Posted July 11, 2007 Share Posted July 11, 2007 <?php echo "<SCRIPT LANGUAGE=\"JavaScript\"> window.location='campExport.php'; window.close();</script>"; ?> Don't know if I did understand the question correctly, as I don't know why the window.close is there. Anyway it seems a javascript question. Quote Link to comment Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 I have a php popup window There is no such thing. PHP runs on the server, pop-ups and windows run on the client. Quote Link to comment Share on other sites More sharing options...
Awanka Posted July 12, 2007 Author Share Posted July 12, 2007 It's a popup window that's opened using javascript, but it's contents are primarily php. Here's the line that calls it. <a href="javascript:void(0)" onclick="openPopup('recentCampSettingsExcel.php', 'recentCampSettingsExcel', 600, 500)"><b>(Export to Excel)</b></a> My problem remains unchanged. I need the popup window to simultaneously redirect to another php page, and also close itself. Quote Link to comment Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 Why redirect if your just going to close the window? You need to perform the window close in the page you are redirected to. Quote Link to comment Share on other sites More sharing options...
Awanka Posted July 12, 2007 Author Share Posted July 12, 2007 How would I do that? Is there some kind of opener.close() javascript function I can use? I would prefer to use one that doesn't use an echo statement. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.