473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SSL vs Port 80

I have a page that can be pulled up either on SSL port 443 or on regular
HTTP port 80.

Can I use PHP to determine through which port the page is being requested?

Thanks,
Santosh
Jul 17 '05 #1
3 2190
Regarding this well-known quote, often attributed to OneSolution's famous
"Tue, 04 May 2004 04:46:52 GMT" speech:
I have a page that can be pulled up either on SSL port 443 or on regular
HTTP port 80.

Can I use PHP to determine through which port the page is being requested?

Thanks,
Santosh


$_SERVER['SERVER_PORT']

The port on the server machine being used by the web server for
communication. For default setups, this will be '80'; using SSL, for
instance, will change this to whatever your defined secure HTTP port is.

From:
http://www.php.net/manual/en/reserve...riables.server

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #2
OneSolution wrote:
I have a page that can be pulled up either on SSL port 443 or on regular
HTTP port 80.

Can I use PHP to determine through which port the page is being requested?

Thanks,
Santosh


That's most probably be in the $_SERVER superglobal somewhere.

put the following code in a test script to find out the name of the hash
index.

<?php // no preceeding spaces

header("Content-Type: text/plain;");
var_dump($_SERVER);

?>

you could also use phpinfo();

Jul 17 '05 #3
Thanks,.
"FLEB" <so*********@mmers.and.evil.ones.will.bow-down-to.us> wrote in
message news:9u****************************@40tude.net...
Regarding this well-known quote, often attributed to OneSolution's famous
"Tue, 04 May 2004 04:46:52 GMT" speech:
I have a page that can be pulled up either on SSL port 443 or on regular
HTTP port 80.

Can I use PHP to determine through which port the page is being requested?
Thanks,
Santosh
$_SERVER['SERVER_PORT']

The port on the server machine being used by the web server for
communication. For default setups, this will be '80'; using SSL, for
instance, will change this to whatever your defined secure HTTP port is.

From:

http://www.php.net/manual/en/reserve...riables.server
--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
0
by: per.bergstrom | last post by:
To whom it may concern, The serial port server 'cnhd38' has been terminated (on who's initiative, I don't know). It affects the users of the (at least) following nodes: cnhd36, cnhd44, cnhd45,...
2
by: willie | last post by:
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. ...
5
by: Jason | last post by:
After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this. If so, how...
6
by: kai | last post by:
Hi, I was tring to run an example (HelloWorld.aspx) from MSPrss book, I get this message: "ASP.NET Development Server faild to start listening port 1034. Error message: An attempt was made...
7
by: Sharon | last post by:
Hi all, I've implemented a TCP server using the Socket async methods. When connecting to the server from 3 instances of hyper terminal, i've noticed that each of the newly created server sockets,...
4
by: H J van Rooyen | last post by:
Hi All, I am writing a polling controller for an RS-485 line that has several addressable devices connected. It is a small access control system. All is well- the code runs for anything from...
25
by: bmearns | last post by:
Is it possible to specify which port to use as the outbound port on a connection? I have the IP address and port number for the computer I'm trying to connect to (not listening for), but it's...
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
5
by: Maciej Sondej | last post by:
Hi, I have problem. I want to react on event which come from IO.Port(RS232). I have a class that works on console application class Program { static void Main(string args) {
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.