I need to close the window after alertbox, I used the codes which was asked in Stack Question But my alert box is inside a php code, I am getting the alert box but once i close it the window is not getting closed, I am new to php . The codes are below, Please help me out guys
<?php
$serial_get = trim(str_replace("(","",str_replace(")","",GetVolumeLabel("d"))));
if ($serial_get == '1233-2AZ2'){
}
else{
echo '<script language="javascript">
window.alert("This is not a Licensed Software. Please contact IT Solutions.");
window.close()
</script>'; }?>
You need window.open(...)
to be able to window.close()
. You are using window.alert()
.
See Best Practice in the link https://developer.mozilla.org/en-US/docs/Web/API/Window.open
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With