SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Encryted URL

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    chennai
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Encryted URL

    Hi All,
    Is there any way to encrypt a value that is passed via url,so that the user doesnot know what the data it is.After that i should be able to decrypt that data and get the necessary info to the user in that php page.

    Any Suggestions?

    Thanks,
    php_kid

  2. #2
    SitePoint Evangelist TRISPECTIVE's Avatar
    Join Date
    Sep 2002
    Location
    n/a
    Posts
    477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would rather use sessions.

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    chennai
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Encrypted Data

    Any other Suggestions from anyone?

    Thanks,
    php_kid

  4. #4
    SitePoint Wizard Dylan B's Avatar
    Join Date
    Jul 2004
    Location
    NYC
    Posts
    1,150
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could concievably base64_encode and base64_decode your strings, but that would make them ugly.

    so like
    PHP Code:
    <?php
    $data 
    'datadatadata';
    $encoded base64_encode($data);
    echo 
    '<a href=\'page.php?data=\'' $encoded '>';
    ?>
    then on page.php
    PHP Code:
    <?php
    $encoded 
    $_GET['data']
    $data base64_decode($encoded);
    echo 
    $data;
    ?>
    Make sure to validate your input, though.

  5. #5
    SitePoint Guru rashidr's Avatar
    Join Date
    Jun 2004
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also use base64 in my another site to encrypt data.


    the url will be look like this http://www.abc.com/xyz.php?id=axyzf1afa==&q=xyxy==


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •