dastaten Posted June 8, 2008 Share Posted June 8, 2008 I have a bit of javascript that I need to run in a php file. Can someone tell me the code to do this in php? <SCRIPT type="text/javascript"> if (confirm("Sign in to Instant Messenger? (Be sure to disable pop-up blocker)") ) { newwindow=window.open('php121/php121im.php','name','height=500,width=240,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no'); if (window.focus) {newwindow.focus()}; } </SCRIPT> I just opens an alert box and if "Ok" is clicked, opens another small window with specific attributes. Any help is greatly appreciated. Thanks, DAStaten Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/ Share on other sites More sharing options...
MiCR0 Posted June 8, 2008 Share Posted June 8, 2008 echo "<SCRIPT type=\"text/javascript\"> if (confirm(\"Sign in to Instant Messenger? (Be sure to disable pop-up blocker)\") ) { newwindow=window.open('php121/php121im.php','name','height=500,width=240,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no'); if (window.focus) {newwindow.focus()}; } </SCRIPT>"; Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560248 Share on other sites More sharing options...
dastaten Posted June 8, 2008 Author Share Posted June 8, 2008 Ah, I remember "echo" now lol. Thanks so much! Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560251 Share on other sites More sharing options...
dastaten Posted June 8, 2008 Author Share Posted June 8, 2008 Well, I spoke too soon. That will only write the code to the page. I need that snippet to execute when the php page loads. The php page should pop up the alert box and then call the other page when "Ok" is clicked. Am I making sense? Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560253 Share on other sites More sharing options...
keeB Posted June 8, 2008 Share Posted June 8, 2008 Am I making sense? No Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560262 Share on other sites More sharing options...
serverman Posted June 8, 2008 Share Posted June 8, 2008 i think he wants it from java to php lol Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560282 Share on other sites More sharing options...
corbin Posted June 8, 2008 Share Posted June 8, 2008 PHP can not make a popup on the client side... You can output javascript, which will in turn make a popup, but you can't make a popup with PHP, if that makes sense. Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560294 Share on other sites More sharing options...
blueman378 Posted June 9, 2008 Share Posted June 9, 2008 so what you will need to do, is set the function and then call it with body onload, Link to comment https://forums.phpfreaks.com/topic/109213-can-someone-translate-this-snippet-for-me/#findComment-560825 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.