Klajdi Dosti Klajdi Dosti - 9 months ago 25
PHP Question

how to redirect with js 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 what 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