Jump to content

[SOLVED] js redirect in php not working


darksniperx

Recommended Posts

Try this, with single echo quotes..

<?php
echo '<script>window.setTimeout("window.location=\'index.php?page=main_page\';",2000);</script>';
?>

 

Edit: Also, I think it should be just "setTimeout()" rather than "windows.setTimeout()", not such a big javascript wiz.

Try this, with single echo quotes..

<?php
echo '<script>window.setTimeout("window.location=\'index.php?page=main_page\';",2000);</script>';
?>

 

Edit: Also, I think it should be just "setTimeout()" rather than "windows.setTimeout()", not such a big javascript wiz.

your code works, also I have remembered to use

?>
<script>window.setTimeout('window.location="index.php?page=main_page"; ',2000);</script>";
<?php

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.