Window.location - javascript in php -


i've create in php programme piece of code:

$dest = 'https://www.google.com';  $stay = 'currenturl';           echo '<pre>';            echo "<script language=\"javascript\">";           echo "    window.location = '". $stay."';";           echo "    var win = null;";           echo "    leftposition = (screen.width) ? (screen.width-995)/2 : 0;";           echo "    topposition = (screen.height) ? (screen.height-640)/2 : 0;";           echo "    settings = 'height=500,width=600,top='+topposition+',left='+leftposition+',scrollbars=no,resizable=yes,status=yes';";           echo "    win = window.open('" . $dest . "','network',settings);";           echo "</script>";            echo '</pre>';               exit;  

if run code open pop window, google, , refresh (because it's idea i've got allow me stay on same page - otherwise goes blank...) current page. want avoid refreshing , stay on same page.

do know how change "window.location" achieved it?

mate, should not use php code open new window injecting js script, that's why going page php code ouput new content current page, should have logic new window in javascript function. should stay on same page


Comments