Reputation: 532
I have a form with one text field and a submit button. The form uses the get method to send input data. I want to decode the text field's user input to base64 and add it to the url instead of the plain text on submit button click.
For example: Instead of http://www.example.com/send.php?inputfield=hello_world I want to have the URL http://www.example.com/send.php?inputfield=[base64 encryption of "hello_world"].
Is there a pure php solution to do so? I know, it is implementable by using Javascript, but I would like to do it completely in PHP.
Upvotes: 0
Views: 1741
Reputation: 91942
This is a client-side problem so no, you cannot do it in PHP because the data is sent before PHP even touches it.
Also, don't confuse base64 with encryption because it is not safe in any way at all. It's made for transmission of binaries over text-based protocols, not for safety.
Upvotes: 4