Hi guys. I need some help writing a code that will open a popup window automatically, as soon as a function is completed. I want to write it in PHP without using javascript. Is that possible? If not, how would I write it using javascript?
Thanks in advance!
Popup window with PHP?
Moderator: General Moderators
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
PHP is server side, while popups are client side, so you need javascript.
Within the <head> tag:
To popup the window:
The call defines the size of the popup window.
Within the <head> tag:
Code: Select all
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
function firstWindow(report,winht,winwth)
{
var windowX = (screen.width/2)-(winwth/2);
s = "top=170,left="+windowX+",width="+winwth+",height="+winht;
reportWindow = window.open(report, 'reportWin',s)
reportWindow.focus()
}
</script>Code: Select all
<a href="javascript:firstWindow('filename.php',385,380)">click here</a>