I am a beginner in HTTPS technology :(. I have some doubt regarding the HTTPS implementation.
suppose I have a registration form
http://www.sitename
HTTPS stands for HTTP Secure. It is implemented via serving HTTP over a secure connection. Take a look at HTTP Secure on Wikipedia for a much more in depth explanation.
Setting up HTTPS isn't a matter of merely changing the URL. You'll have to add a SSL certificate to your website to do that. These certificates can be obtained from Certificate Authorities (List of CAs) or you can use a self signed certificate.
Speaking to your doubts of the HTTPS implementation. It is a well established protocol which has gone through its paces by security experts with Ph.D's on the subject. So you can trust the implementation of HTTPS.
Flat Mountain has a good article for Setting up SSL Certificates on Apache*
*assuming you're running your php through apache server
whew. um. You need to look at ssl and secure http. And possibly setting up ssl on apache.
Basically, it is an encrypted http connection. Ask yourself why you need an encrypted connection and is it really worth all the trouble.
HTTPS involves many layers and they are all there to ensure that your HTTP communication over the wire is encrypted and secure. One of the mechanisms it uses to ensure that security, is to prove to the client that the server is actually who he says he is and not someone who pretending to be the server. This is achieved using server certificates that are issued by certificate authorities that most clients trust.
Thus, you would need a few things for your form to work over HTTPS securely:
"www.sitename.com"
)For your, register.php
page there won't be a difference between clients that come from HTTPS or HTTP, your handling will be the same. However, if you want to force users to use HTTPS then you need to first check to see if the request is plain HTTP and if it is redirect the user to the same page with the HTTPS protocol. That way no one can inadvertently use the insecure address.
Serving over the https protocol means you are serving encrypted data, that in theory cannot be sniffed because it is not transmitted in plain text. The connection is usually over port 443 and not the typical port 80 for HTTP traffic.
Also SSL provides for a certificate that authenticates you the content server with a third party, such as VeriSign or others.
For a professional site you can buy a certificate to install on your server, or in other cases it may be better to use a self signed certificate, although those will typically display a nasty error in common browsers (which may not be an issue if you only have trusted/trusting users).
If your site is run on apache, you'll need to setup ssl and then make sure you're vhost is setup to listen on 443 as well. Then any page in the vhost can be called with either protocol.
http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html
http://en.wikipedia.org/wiki/HTTP_Secure
Others have given you good links to resources on exactly how HTTPS works. I'll address the two reasons why it is used:
1. Security
When using HTTPS, the traffic between your browser and the web server is encrypted. This prevents anyone who happens to have access to any of the many wires that your data will traverse as it crosses the Internet from looking at what you are sending the server, or what the server is sending you. This is why HTTPS is used for sending passwords and other login credentials. This is one reason why websites dealing with banking and other matters that require privacy use HTTPS. This is why you probably want to use HTTPS if you are reading your webmail from a public wi-fi connection.
2. Identity
When connecting via HTTPS, the web server provides to you a certificate. In addition to containing the public key needed to facilitate the encryption mentioned above, the certificate also attempts to prove the identity of the web server. This prevents anyone who happens to have access to any of the many wires that your data will traverse as it crosses the Internet from diverting your traffic to their server instead, and pretending to be the website you wanted to contact. All the encryption in the world doesn't help if you established that encrypted connection with a hacker.
To do this, certificates are "signed" by a Certificate Authority. Certificate Authorities aim to verify that the person they issue a certificate to is who they claim to be. That is, a CA will not issue a "bankofamerica.com" certificate to anyone other than Bank of America. Your browser comes with a pre-installed set of Certificate Authorities whose signatures it trusts. If the certificate the server gives you is not signed by one of these trusted CAs, the browser will warn you.
Note that failure of the identity step does not impede the security step. If an HTTPS server gives you a certificate that is not signed by a CA that your browser trusts, you can still establish an encrypted, secure connection with the server - you just can't be sure of who is actually running the server that you're talking to.