Jump to content

Recommended Posts

No can do, its not serverside, it cannot control the browser. Use Javascript or HTML.

i would suggest a meta refresh or a little js wrapped in and if statement...

 

<?php
if($variable==true) {
?>
<script>
window.open("www.google.co.uk");
</script>
<?php } ?>

 

or

<meta http-equiv="refresh" content="1;URL=http://google.co.uk" target="_blank">

 

 

Link to comment
https://forums.phpfreaks.com/topic/224615-header-pop-up/#findComment-1160332
Share on other sites

Just to clarify same window does not mean server side, serverside means that the script is processed on the hosting server and then passed to the users browser as html, php does this, clientside means that the script is processed on the clients machine and modifies the contents of the users web browser, javascript does this.

 

The reason you couldnt do what you wanted with php is because php has no actual communication with the users web browser as it has finished its job before it gets there, and thus we use scripts like javascript to perform any actions we need on the users web browser, such as onclick events, onmouse over events, pop ups etc etc

Link to comment
https://forums.phpfreaks.com/topic/224615-header-pop-up/#findComment-1160571
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.