1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hide Querystring in URL

Discussion in 'PHP' started by FarSeer, Mar 15, 2008.

  1. FarSeer

    FarSeer New Member

    Joined:
    Mar 15, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    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!
     
  3. FarSeer

    FarSeer New Member

    Joined:
    Mar 15, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    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?
     
  4. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
  5. FarSeer

    FarSeer New Member

    Joined:
    Mar 15, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  6. FarSeer

    FarSeer New Member

    Joined:
    Mar 15, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    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?
     
  7. FarSeer

    FarSeer New Member

    Joined:
    Mar 15, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  8. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Yeah right! :)
     

Share This Page