Klajdi Dosti Klajdi Dosti - 1 year ago 48
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!

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download