how to implement ssl

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

how to implement ssl

Post by itsmani1 »

Hi...

I want to make login more secure using ssl. Can anyone please tell me what will be the steps for it. i want to make login more secure uisng ssl. right now all the page of site are working normally means without ssl etc.

Please guide me.

thanks in advance.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

This is handled at a web server level. If you're using Apach you just need to install mod_ssl. The PHP code need not care either way if it's SSL or not.
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

but how php code will come to know that this file is a secured and this file is not secured. i wanted to open few files with https and other with http only.

thanks
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

With apache you can use <Location> and <Directory> statements to isolate where SSL should be used.

The PHP code can check what's SSL and what's not by checking for a non-empty value $_SERVER['HTTPS']. That's explained in the manual.

If you need to swap and change between SSL and non-SSL whilst carrying session data search these forums as it's been discussed many times before -- it's doesn't "just work" ;)
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Post by itsmani1 »

ok thanks.

will my session work fine on both http and https or i will have to do something so that it work fine. someone told me that for security purpose i have to put thoese files in my ssl folder simple is that. is it that much simple?

thanks
User avatar
ddragas
Forum Contributor
Posts: 445
Joined: Sun Apr 18, 2004 4:01 pm

Post by ddragas »

my sessions are working fine with https even ssl folder.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

ddragas wrote:my sessions are working fine with https even ssl folder.
it's crossing over from http to https and vice versa where the issue arises.
Post Reply