faqts : Computers : Programming : Languages : PHP : Common Problems : HTTP Headers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

42 of 47 people (89%) answered Yes
Recently 7 of 10 people (70%) answered Yes


Is there a way to "pop up" a page using PHP? Something like Javascript's window.open.

Jun 19th, 2003 07:44
Phlip, taylor gerring, Virgilio Cantu,

No, PHP cannot accomplish this. PHP is a server-side script. This 
means that it can only interpret information and pass it to the 
client. JavaScript is a client-side script, whereby the actions are 
performed on the client's end (i.e. popping up a new window).
But you can write javascript to the page, eg:
$a_page = "mypage.htm";
$title = "newwin";
$details = "height=100,width=200";
print "<SCRIPT> window.open($a_page, $title, $details) </SCRIPT>";