LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Thread Tools
Old 10-30-2002, 04:59 PM   #1
antken
Member
 
Registered: Nov 2000
Location: england
Distribution: latest Mandrake
Posts: 368
Thanked: 0
https or http?


[Log in to get rid of this advertisement]
hi,


how can i use php to workout if a user is using https ?


basically i want to make certain that my users get redirected from a non secure site to a secure one


any ideas?
antken is offline     Reply With Quote
Old 10-30-2002, 05:50 PM   #2
leed_25
Member
 
Registered: Jul 2002
Location: san francisco
Distribution: freebsd
Posts: 102
Thanked: 0
maybe you could try something like this (untested):
Code:
if (preg_match("/^https/i",  $_SERVER['SERVER_PROTOCOL'])) {
   //  your code here
}

Last edited by leed_25; 10-30-2002 at 05:53 PM..
leed_25 is offline     Reply With Quote
Old 10-30-2002, 05:58 PM   #3
antken
Member
 
Registered: Nov 2000
Location: england
Distribution: latest Mandrake
Posts: 368
Thanked: 0

Original Poster
i take it then looking at that code ' preg_match ' is the equlivilent of grep at the command line?
antken is offline     Reply With Quote
Old 10-30-2002, 06:06 PM   #4
leed_25
Member
 
Registered: Jul 2002
Location: san francisco
Distribution: freebsd
Posts: 102
Thanked: 0
'preg' stands for 'perl regular expression'.

dig into this
leed_25 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
https works, but not http squeaks_27 Linux - Networking 1 05-31-2005 09:41 PM
http and https wennie Linux - Software 1 04-01-2005 12:47 PM
Got http, now I need to run https lothario Linux - Software 2 01-08-2005 03:30 PM
HTTP versus HTTPS Linh Linux - Security 5 09-18-2003 12:13 PM
HTTP to HTTPS shegde Linux - Software 8 01-31-2003 05:29 AM


All times are GMT -5. The time now is 02:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration