2

Example we have a form :

<form action="" method="GET">
<input type="text" name="Search">
<input type="submit" value="Search">
</form>

if click on Search btn url will redirect to

search.php?Search=parametr

how i can Encode This Parametr As Base64 ?

search.php?Search=cGFyYW1ldHI=
Unkn0wn
  • 78
  • 4
  • 1
    [`base64_encode`](http://php.net/base64_encode). If you have woes with some specific usage, you'll have to show your code. – mario Jul 09 '15 at 10:23
  • 2
    If this is actually about client-side form encoding, then look for javascript questions, such as [How can you encode a string to Base64 in JavaScript?](http://stackoverflow.com/q/246801) – mario Jul 09 '15 at 10:27
  • possible duplicate of [How can you encode a string to Base64 in JavaScript?](http://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript) – OIS Jul 09 '15 at 10:31

1 Answers1

0

It should be as simple as that. If you want to send the encoded parameter in the url you have to encode it before your html response. Else this encoding makes no sense anyway.

$base64 = base64_encode($parameter); 
oshell
  • 8,923
  • 1
  • 29
  • 47