Can I submit data with encryption on a get method form?
Printable View
Can I submit data with encryption on a get method form?
Yes if your form target is specified to use HTTPS.
PHP Code:<form method="GET" action="https://example.com/somewhere">
What would that do penagate? What's the difference if it uses HTTPS?
The communication is encrypted using SSL.
So the GET parameters don't show?
Well, that is a good point. Since GET parameters are appended to the URL you are better off putting sensitive data in a POST body.
I know that, But I don't know how to transfer data between 2 pages automatically (Without submitting by user) with post method.
So I do that
One way would be to make a form, and then submit it by javascript. Might not be the best way though...
You CANT at least if you use Post method
You can!!!!!! But I wouldn't recommend it.
The query string is hidden when making an SSL request so you don't need to worry. Also, you shouldn't be transferring sensitive information back and forth even when it is encrypted; as you can store it in a server side session.
How SSL works:
- A TCP connection on port 443 is first established with the server.
- The client says hello. It also sends all its supported ciphers and key exchange protocols.
- The sever sends its certificate and the client verifies the certificate and authenticates the server, usually by use of a digital signature.
- Upon verification the client and server agree on a key exchange protocol and an encryption cipher.
- The server and client exchange the key.
- The HTTP request is then encrypted using this key and sent to the server:
Code:GET /index.php?value=secret&value2=versecret HTTP/1.1
Host: www.example.com
- When the server receives the encrypted request it uses the agreed key to decrypt it.
- The server then encrypts the response with the agreed key and sends it back to the client.
See, no query string data ever gets seen between the two end points unencrypted. The only visible data are the source and destination IP addresses and the encrypted communications.