Jump to content

Can someone translate this snippet for me?


dastaten

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.