Windows 8 or php 5.4 page url

Hi,

I’ve just installed wamp on a windows 8 PC, with php 5.4. Prior to this new PC, I was using windows 7 with php 5.3

The below code causes errors on localhost using windows 8, wamp, php5.4 (the code works on windows7 localhost wamp php 5.3)
SCREAM error suppression ignored . . .
Undefined index HTTPS

I don’t know if the error is from using windows 8 or from php 5.4.3 instead of php 5.3.1.3
Or that my code is bad and that my old machine doesn’t see it.
The code works perfect online.

To get MyPhpAdmin to work on localhost, I had to modify either phpmyadmin.conf (by putting allow from ::1) or httpd.conf (by putting listen to 0.0.0.0:80)
I’ve tried both and it doesn’t seem to affect what happens with the below code.

TIA for any help

<?php
//function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
//return $pageURL;
//}
?>