-2

Sorry, I am new to Coding.

window.location.href = "<?php echo SITE_URL; ?>ajaman.php";

The Above Code just Prints the URL from Ajaman.php instead of Opening it..!! How to directly open it ?

1 Answers1

0

Try this,

$(window).load(function() {
window.location.href ="<?=$_SERVER['SERVER_NAME']
$_SERVER['REQUEST_URI']; ?>/ajaman.php";
});

the php tags inside the js script will only work in php pages. Not work in .js files.

Rogin Thomas
  • 672
  • 8
  • 17