LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 10-30-2002, 03:59 PM   #1
antken
Member
 
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
https or http?


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?
 
Old 10-30-2002, 04:50 PM   #2
leed_25
Member
 
Registered: Jul 2002
Location: san francisco
Distribution: freebsd
Posts: 102

Rep: Reputation: 17
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 04:53 PM.
 
Old 10-30-2002, 04:58 PM   #3
antken
Member
 
Registered: Nov 2000
Posts: 368

Original Poster
Rep: Reputation: Disabled
i take it then looking at that code ' preg_match ' is the equlivilent of grep at the command line?
 
Old 10-30-2002, 05:06 PM   #4
leed_25
Member
 
Registered: Jul 2002
Location: san francisco
Distribution: freebsd
Posts: 102

Rep: Reputation: 17
'preg' stands for 'perl regular expression'.

dig into this
 
  


Reply



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 08:41 PM
http and https wennie Linux - Software 1 04-01-2005 11:47 AM
Got http, now I need to run https lothario Linux - Software 2 01-08-2005 02:30 PM
HTTP versus HTTPS Linh Linux - Security 5 09-18-2003 11:13 AM
HTTP to HTTPS shegde Linux - Software 8 01-31-2003 04:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration