Klajdi Dosti Klajdi Dosti - 1 month ago 5
Javascript Question

how to redirect with javascript and make possible not to turn back in first document

i want to redirect to a php page for example

and i want to make possible not to turn back to the first page.
any of that ---

header("location: example.php)

cant do want i want.
is there any javascript method or php function to make that?
Thanks in advance!


In Javascript you can use location.replace() to assign a new url - it forgets the previous location ( removes from history )

location.replace( 'example.php' );

For reference, try MDN