Help on Hiding Parameters

Discussion in 'PHP' started by bartolay13, Nov 11, 2007.

  1. #1
    Hello again,

    im just asking if is it possible to hide parameters??

    my URL shows like this:
    http://localhost/AAI/administrator/index2.php?admin_menu=2&subContent=2&hsch_account=3

    i want to hide the characters in red font...

     
    bartolay13, Nov 11, 2007 IP
  2. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you should use $_POST
    instead of $_GET then
     
    Lordy, Nov 11, 2007 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    -_-
    heres my sample script, redirection, with parameter passing
    file1.php
    
    <a href=\"index2.php?admin_menu=2&subContent=2&hsch_account=2&search=1\">MANAGE Highschool Accounts</a></li>
    
    PHP:
    file2.php
    
    echo $_GET['admin_menu']; // <<---- if i use post here, it wont catch the parameter from file1.php
    
    PHP:
    how could i hide characters in the URL?? some say that there is a way
     
    bartolay13, Nov 11, 2007 IP
  4. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Instead of linking to the page, add an onclick event listener that submits a form with 'post' method.

    <a href="javascript:void(null);" onclick="document.getElementById('myform').submit();">MANAGE Highschool Accounts</a>
    
    <form id="myform" action="index2.php" method="post">
    <input type="hidden" name="admin_menu" value="2" />
    <input type="hidden" name="subContent" value="2" />
    ...
    </form>
    HTML:
    Not the cleanest way to do it, but I think is easy to understand.
     
    phper, Nov 11, 2007 IP
  5. jonimontana

    jonimontana Well-Known Member

    Messages:
    262
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #5
    http://localhost/AAI/administrator/index2.php?admin_menu=2&subContent=2&hsch_account=3

    you can Encode the all thing and then decode it (i show the base64 way , you can make one on your own)

    ppls can crack it ,( just for you to know)
     
    jonimontana, Nov 11, 2007 IP
  6. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #6
    I think phper's will be the safest way, I tried BASE 64 encode, its the same process, the only thing is its hashed.

    Thanks anyways..

    Problem Solved!
     
    bartolay13, Nov 12, 2007 IP