简体   繁体   中英

how to handle pop-up windows in php

I've searched extensively on the web about how to handle pop-up windows in PHP without finding any useful info. There is a bit for VBA but not really portable to PHP.

After I modify one or more fields and submit the web page to be saved, this pop-up appears with the OK button to click on that completes the saving process.

Is there a way to handle it via a PHP script?

PHP is a server side language. Any popup on your webpage is probably done with Javascript, which is a client side language (well, at least in this context it is). So no, there's no way to handle this with only PHP.

you can do it with javascript

onclick="centerPopUp('abc.php','windowname1','width=1000, height=1000'); return false;"
<script>
function centerPopUp( url, name, width, height, scrollbars ) { 
str = "";
str += "scrollbars=1,";
str += "width=" + width + ","; 
str += "height=" + height + ",";
str += "resizable=0,"; 
str += "scrollbars=" + scrollbars + ","; 
str += "width=" + width + ","; 
str += "height=" + height + ",";*/
window.open( url, name, str ); 
}
</script>

You can use Use jquery, AJAX, javascript to achieve the requited functionality. Pure PHP Will not able to do this stuff.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM