Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Hide Querystring in URL (http://www.go4expert.com/forums/hide-querystring-url-t9366/)

FarSeer 16Mar2008 03:50

Hide Querystring in URL
I know this is a common question, but is there a way to hide the GET variables from the browser's url? The catch is, I'm sending the variables via a link so I can't use the POST method.

pradeep 16Mar2008 21:40

Re: Hide Querystring in URL
Yiou can't hide it, you can encrypt it or use iframes like GMail does, so that people don't see the URL while browsing!

FarSeer 17Mar2008 07:30

Re: Hide Querystring in URL
Thanks for the reply. Let me ask a different question; Would it be possible to eliminate the variables after my code is done executing so that they are visible only while the page is loading?

pradeep 17Mar2008 10:24

Re: Hide Querystring in URL
Yes! Say you call a script with an id, then you can redirect it to an URL which does not have the id in the URL.

http://urdomain.com/delete.php?id=154 --> visible, while loading
after processing, redirect to
http://urdomain.com/deleteconfirmation.php --> id not present

FarSeer 18Mar2008 06:40

Re: Hide Querystring in URL
OK. I think I know what you're saying. I can acquire the variables then store them in a temporary session while I reload the page without the querystring in the URL. Thank you for the help.

FarSeer 18Mar2008 07:05

Re: Hide Querystring in URL
I have the following code:

include "code.php";
if(!isset($_SESSION['video'])) {
$decode = $_GET['video'];
$video = decoded($decode);
$_SESSION['video'] = $video;
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=video.php">';}

However, the page just continually reloads ad infinitum. What am I missing?

FarSeer 18Mar2008 07:16

Re: Hide Querystring in URL
OK. I figured it out. I was destroying the session before the page reloaded. It works great now.

I'm sorry about all of these posts. I can't edit/delete my posts.

pradeep 18Mar2008 10:12

Re: Hide Querystring in URL
Yeah right! :-)

All times are GMT +5.5. The time now is 07:23.