Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

from http to https 3

Status
Not open for further replies.

joeschoe

Programmer
Jan 13, 2002
67
IL
I have a web site developed using php.
I now want the site to be accessed using https so that the lock icon shows on the page.
When I ask my host provider, all he can tell me is that I need a certificate.
After that what do I have to do in the PHP source code?

I do not use a SQL database, I maintain a sequential file which I check when users login against the "$PHP_AUTH_PW" variable.
 
I am using PHP scripts on a webserver with both http and https.

Once you acquire the certificate you need to install it on the server. You may need to configure the server if you need to require SSL to your scripts, but this has nothing to do with PHP.

I did not have to change any scripts.
 
PHP doesn't care whether it is http or https. You don't have to do anything.
 
damomac wrote that he is using http and https on the same server.
How does this get controlled? If I install a certificate how do I enforce https for some programs and not for others?
This may now be in the wrong forum but perhaps someone will know the amswer anyway.
 
Don't you have to specify http: in any url ?. Strictly speaking you only need https on the action of the form tag, most people use it on the login page just to tuen on the pad lock.
Also (I recall) you can't use relative url (e.g. /fred/pag1.php) when using https you have to give the entire url
 
Thanks ingresman, the info on relative and entire url is useful, however, it does not explain how to have both types on the same server.
Can I invoke and ?
What differentiates one from the other?
 
joeschoe: That question is a webserver forum question, as it has nothing to do with PHP.

You should post in the webserver forum for an answer to that question. Setting that up will be different depending on the webserver software being used.

First figure out which webserver software you are using then post in the appropriate forum. A common webserver is Apache (located in forum65).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top