-1

I'm a beginner in PHP. Is it possible to hash $_GET data before sending it?

For example, I want to redirect to :

samplepage.php?id=1

How do I turn it into:

samplepage.php?id=6rP7Fre4QkZShmTbpCuhuV.GV/BYPfj2kj7K

And then how to I decode this?

Thanks.

PHP Ninja
  • 1,055
  • 2
  • 9
  • 28
  • 1
    Does this answer your question? [Simplest two-way encryption using PHP](https://stackoverflow.com/questions/9262109/simplest-two-way-encryption-using-php) – executable Dec 02 '19 at 11:00
  • see [this](https://stackoverflow.com/questions/16600708/how-do-you-encrypt-and-decrypt-a-php-string) – jagad89 Dec 02 '19 at 13:03

1 Answers1

0

you can add base64_encode() to encode and base64_decode() to decode.

base64_decode($_GET['id']) will give you the original value.

SHR
  • 7,940
  • 9
  • 38
  • 57