Hide Querystring in URL

FarSeer's Avatar, Join Date: Mar 2008
Light Poster
Hello,
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's Avatar, Join Date: Apr 2005
Team Leader
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's Avatar, Join Date: Mar 2008
Light Poster
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's Avatar, Join Date: Apr 2005
Team Leader
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's Avatar, Join Date: Mar 2008
Light Poster
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's Avatar, Join Date: Mar 2008
Light Poster
I have the following code:
Code:
<?php
session_start(); 
include "code.php";
?>
<html>
<head>
<?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's Avatar, Join Date: Mar 2008
Light Poster
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's Avatar, Join Date: Apr 2005
Team Leader
Yeah right! :-)