Skip to content Skip to sidebar Skip to footer

Hide Url Parameters In Javascript

I am using this: document.location ='my different asp.net page?=myparams' Is there a way to hide the values of the params in the URL displayed on the browser? I know I could use h

Solution 1:

If you are just trying to hide the url parameters from the address bar in the browser then you could use an iframe.

Solution 2:

One solution is to set document.location to a second page, that page keep param values in a session variable and redirect to your desired one.

document.location = "redirectpage.php?param=value"

In redirectpage.php

$_SESSION['param']=$_GET['param]; header('Location: ' . desired_page?param=value);

By this way, value of param will be only displayed in a very short time when redirectpage.php redirecting to desired page.

Hope it helps

Btw, can you explain how hidden Form works in this case?

Post a Comment for "Hide Url Parameters In Javascript"