Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
Try...

$_SERVER['HTTP_REFERER']

John Taylor-Johnston wrote:

The deal is my ISP does a redirect from www.delete.compcanlit.ca to www.delete.compcanlit.usherbrooke.ca. I'm trying to if statement the redirect. Again, I find no variable in phpinfo().
John





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Beginner examples?

2002-12-23 Thread Chris Rehm
John W. Holmes wrote:

http://www.google.com/search?sourceid=navclientie=UTF-8oe=UTF-8q=php+
mysql+tutorial

---John W. Holmes...


John, I am grateful for the suggestion and I will pass it along. I have 
already given some insight as to how to find tutorials on the web and 
the like. What I was looking for was more some recommendations from 
personal experience.

The Internet is a wealth of resources, but some of them aren't as good 
as others. If people here have had great success from some sites, I'd 
like to be able to pass on those recommendations.

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/


--
Chris Rehm
[EMAIL PROTECTED]

For all the law is fulfilled in one word, even in this; Thou shalt love 
thy neighbour as thyself.
Gal. 5: 14




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with Include

2002-12-23 Thread sport4ever
It's PHP problem because I can include any number of files with other
extensions. only PHP which I can not include more than one file at a page...

maybe there is something wrong with php.ini
notice that I faced with this problem just after I upgraded to (PHP 4.2.1),
(Apache2), everything was great before!

- Original Message -
From: Tom Ray [EMAIL PROTECTED]
To: sport4ever [EMAIL PROTECTED]
Sent: Tuesday, December 24, 2002 6:03 AM
Subject: Re: [PHP] Problem with Include


 You need to post your code that you are usingthis isn't really a PHP
 problem this is a SSI problem...

 sport4ever wrote:

 Hello,
 my problem is that I can't use more than one SSI INCLUDE in a page
 
 Please access this test page to check the problem yourself:
 http://www.sport4ever.com/test/hello.shtml
 
 The first INCLUDE will appear correctly and prints HELLO World, include
#1 which is the output of hello.php
 
 Whereas the second INCLUDE won't appear, and instead, it will print the
content (code) of hello2.php, which is the follwoing:
 ? echo HELLO World, include #1; ?
 
 So, it always executes the first include statement perfectly, and doesn't
execute the rest!
 
 note: the problem appears only if I include a PHP file, it will execute
it correctly if it's a SHTML or HTML file.
 
 PLEASE is there any solution for this strange problem!
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Beginner examples?

2002-12-23 Thread John W. Holmes
In that case, check out

www.devshed.com
www.phpbuilder.com
www.zend.com
www.webmonkey.com

Those sites have very good tutorials on a variety of PHP topics. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Chris Rehm [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 24, 2002 12:02 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Beginner examples?
 
 John W. Holmes wrote:
 
http://www.google.com/search?sourceid=navclientie=UTF-8oe=UTF-8q=php+
  mysql+tutorial
 
  ---John W. Holmes...
 
 John, I am grateful for the suggestion and I will pass it along. I
have
 already given some insight as to how to find tutorials on the web and
 the like. What I was looking for was more some recommendations from
 personal experience.
 
 The Internet is a wealth of resources, but some of them aren't as good
 as others. If people here have had great success from some sites, I'd
 like to be able to pass on those recommendations.
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
  today. http://www.phparch.com/
 
 --
 Chris Rehm
 [EMAIL PROTECTED]
 
 For all the law is fulfilled in one word, even in this; Thou shalt
love
 thy neighbour as thyself.
 Gal. 5: 14
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
 What happened when you tried that?

Nothing. Nothing showed. In fact nothing for getenv('REMOTE_HOST') in the else either.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] REMOTE_HOST

2002-12-23 Thread John Nichel
Did you try $_SERVER['HTTP_REFERER'] ?

John Taylor-Johnston wrote:

What happened when you tried that?



Nothing. Nothing showed. In fact nothing for getenv('REMOTE_HOST') in the else either.





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
John,
John,

Nothing.

echo $_SERVER['HTTP_REFERER'].'br';
echo getenv('REMOTE_HOST').'hr';


Try looking at: http://compcanlit.usherbrooke.ca/
or
http://compcanlit.ca/ which will redirect to http://compcanlit.usherbrooke.ca/

I even made a link on a blank page on my desktop and from an email message. Nothing 
appeared as the referrer.

John

John Nichel wrote:

 Try...

 $_SERVER['HTTP_REFERER']

 John Taylor-Johnston wrote:
  The deal is my ISP does a redirect from www.delete.compcanlit.ca to 
www.delete.compcanlit.usherbrooke.ca. I'm trying to if statement the redirect. Again, 
I find no variable in phpinfo().
  John
 
 

 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
But something does appear when you click on the links in this post, but not on a blank 
page nor from the server redirect?? Oh well.
Any other avenues? I thought something would appear from a link from a blank .htm file 
to the site??

John



 John,
 John,

 Nothing.

 echo $_SERVER['HTTP_REFERER'].'br';
 echo getenv('REMOTE_HOST').'hr';

 Try looking at: http://compcanlit.usherbrooke.ca/
 or
 http://compcanlit.ca/ which will redirect to http://compcanlit.usherbrooke.ca/

 I even made a link on a blank page on my desktop and from an email message. Nothing 
appeared as the referrer.

 John

 John Nichel wrote:

  Try...
 
  $_SERVER['HTTP_REFERER']
 
  John Taylor-Johnston wrote:
   The deal is my ISP does a redirect from www.delete.compcanlit.ca to 
www.delete.compcanlit.usherbrooke.ca. I'm trying to if statement the redirect. Again, 
I find no variable in phpinfo().
   John
  
  
 
  --
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com

 --
 John Taylor-Johnston
 -
 If it's not open-source, it's Murphy's Law.

   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John W. Holmes
REFERRER isn't always set, so that may be the problem.

Try just a simple HTML page that has a link to a PHP page that echo's
out $_SERVER['HTTP_REFERRER']. 

Does that work?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 24, 2002 12:28 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: REMOTE_HOST
 
 John,
 John,
 
 Nothing.
 
 echo $_SERVER['HTTP_REFERER'].'br';
 echo getenv('REMOTE_HOST').'hr';
 
 
 Try looking at: http://compcanlit.usherbrooke.ca/
 or
 http://compcanlit.ca/ which will redirect to
 http://compcanlit.usherbrooke.ca/
 
 I even made a link on a blank page on my desktop and from an email
 message. Nothing appeared as the referrer.
 
 John
 
 John Nichel wrote:
 
  Try...
 
  $_SERVER['HTTP_REFERER']
 
  John Taylor-Johnston wrote:
   The deal is my ISP does a redirect from www.delete.compcanlit.ca
to
 www.delete.compcanlit.usherbrooke.ca. I'm trying to if statement the
 redirect. Again, I find no variable in phpinfo().
   John
  
  
 
  --
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com
 
 --
 John Taylor-Johnston


--
 ---
 If it's not open-source, it's Murphy's Law.
 
   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
Interestingly, the referred page displayed when you click on this link 
http://compcanlit.ca/ when referred to http://compcanlit.usherbrooke.ca/ is the same.

So I can't detect the server redirect? Bummer?


 But something does appear when you click on the links in this post, but not on a 
blank page nor from the server redirect?? Oh well.
 Any other avenues? I thought something would appear from a link from a blank .htm 
file to the site??

 John

  John,
  John,
 
  Nothing.
 
  echo $_SERVER['HTTP_REFERER'].'br';
  echo getenv('REMOTE_HOST').'hr';
 
  Try looking at: http://compcanlit.usherbrooke.ca/
  or
  http://compcanlit.ca/ which will redirect to http://compcanlit.usherbrooke.ca/
 
  I even made a link on a blank page on my desktop and from an email message. 
Nothing appeared as the referrer.
 
  John
 
  John Nichel wrote:
 
   Try...
  
   $_SERVER['HTTP_REFERER']
  
   John Taylor-Johnston wrote:
The deal is my ISP does a redirect from www.delete.compcanlit.ca to 
www.delete.compcanlit.usherbrooke.ca. I'm trying to if statement the redirect. Again, 
I find no variable in phpinfo().
John



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
 REFERRER isn't always set, so that may be the problem.

 Try just a simple HTML page that has a link to a PHP page that echo's
 out $_SERVER['HTTP_REFERRER'].

 Does that work?

No.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
What do you get with this...

echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );

John Taylor-Johnston wrote:

But something does appear when you click on the links in this post, but not on a blank page nor from the server redirect?? Oh well.
Any other avenues? I thought something would appear from a link from a blank .htm file to the site??

John





John,
John,

Nothing.

echo $_SERVER['HTTP_REFERER'].'br';
echo getenv('REMOTE_HOST').'hr';

Try looking at: http://compcanlit.usherbrooke.ca/
or
http://compcanlit.ca/ which will redirect to http://compcanlit.usherbrooke.ca/

I even made a link on a blank page on my desktop and from an email message. Nothing appeared as the referrer.

John

John Nichel wrote:



Try...

$_SERVER['HTTP_REFERER']

John Taylor-Johnston wrote:


The deal is my ISP does a redirect from www.delete.compcanlit.ca to www.delete.compcanlit.usherbrooke.ca. I'm trying to if statement the redirect. Again, I find no variable in phpinfo().
John




--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

 ' ' '   Collège de Sherbrooke:
ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
  - Université de Sherbrooke:
 http://compcanlit.ca/
 819-569-2064



--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
What do you get with this...
echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );

From a blank HTML page, I get:

Array
(
[DOCUMENT_ROOT] = /var/www/html2
[HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, 
*/*
[HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
[HTTP_ACCEPT_ENCODING] = gzip
[HTTP_ACCEPT_LANGUAGE] = en,fr
[HTTP_CONNECTION] = Keep-Alive
[HTTP_HOST] = compcanlit.usherbrooke.ca
[HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
[PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
[REDIRECT_STATUS] = 200
[REDIRECT_URL] = /
[REMOTE_ADDR] = 142.169.108.39
[REMOTE_PORT] = 1064
[SCRIPT_FILENAME] = /var/www/html2/index.html
[SERVER_ADDR] = 132.210.13.10
[SERVER_ADMIN] = root@localhost
[SERVER_NAME] = compcanlit.usherbrooke.ca
[SERVER_PORT] = 80
[SERVER_SIGNATURE] =
Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80


[SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.0
[REQUEST_METHOD] = GET
[QUERY_STRING] =
[REQUEST_URI] = /
[SCRIPT_NAME] = /index.html
[PATH_TRANSLATED] = /var/www/html2/index.html
[PHP_SELF] = /index.html
[argv] = Array
(
)

[argc] = 0



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston

echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );

On the redirect from http://compcanlit.ca/, I get:

Array
(
[DOCUMENT_ROOT] = /var/www/html2
[HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, 
*/*
[HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
[HTTP_ACCEPT_ENCODING] = gzip
[HTTP_ACCEPT_LANGUAGE] = en,fr
[HTTP_CONNECTION] = Keep-Alive
[HTTP_HOST] = compcanlit.usherbrooke.ca
[HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
[PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
[REDIRECT_STATUS] = 200
[REDIRECT_URL] = /
[REMOTE_ADDR] = 142.169.108.39
[REMOTE_PORT] = 1066
[SCRIPT_FILENAME] = /var/www/html2/index.html
[SERVER_ADDR] = 132.210.13.10
[SERVER_ADMIN] = root@localhost
[SERVER_NAME] = compcanlit.usherbrooke.ca
[SERVER_PORT] = 80
[SERVER_SIGNATURE] =
Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80


[SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.0
[REQUEST_METHOD] = GET
[QUERY_STRING] =
[REQUEST_URI] = /
[SCRIPT_NAME] = /index.html
[PATH_TRANSLATED] = /var/www/html2/index.html
[PHP_SELF] = /index.html
[argv] = Array
(
)

[argc] = 0



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Undefined Functions

2002-12-23 Thread Beauford.2002
Finally got it working, but I have no idea how. I rewrote the script
changing a few if's and elseif's so there weren't as many, but still calling
the functions from the if/else statements. The format of the new script is
the same as the old one, and other than a few modifications, I still can't
see where the old one failed. In any event, I appreciate the help from all
who responded.

Beauford

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Monday, December 23, 2002 2:40 PM
Subject: Re: [PHP] Undefined Functions


 I have no idea what you have done wrong.  I am simply telling you how it
 works.  Create a small test script that reproduces the problem and we can
 help you.  What you have provided so far does not give us anything to work
 with.

 Try this, for example:

 ?
 if(true) func1();
 else func2();

 function func1() { echo 1; }
 function func2() { echo 2; }
 ?

 When you run this you will see that it prints out 1 which should satisfy
 you that you can safely call functions inside conditionals and have them
 be defined at the bottom of your script.

 Your job now is to tell us how your script differs from the above test
 script, because as far as I have understood this is the exact situation
 you say isn't working.

 -Rasmus

 On Mon, 23 Dec 2002, Beauford.2002 wrote:

  Then based on the one below that doesn't work, what is the problem with
it?
  As I said, the functions are at the bottom of the script. The only thing
  after them is the closing ?. I also said that they work if I don't call
  them from within an if/else. This tells me it is not where it is defined
but
  where it is being called from. Your saying this doesn't matter, but have
not
  given any reasons for my problems.  If you could elaborate on this it
would
  be appreciated.
 
  Beauford
 
  - Original Message -
  From: Rasmus Lerdorf [EMAIL PROTECTED]
  To: Beauford.2002 [EMAIL PROTECTED]
  Cc: PHP General [EMAIL PROTECTED]
  Sent: Monday, December 23, 2002 11:14 AM
  Subject: Re: [PHP] Undefined Functions
 
 
   Like I said, where you define your function is important, not where
you
   call it.  If you are defining and calling it all in the same place,
then
   yes, obviously it makes a difference.
  
   -Rasmus
  
   On Mon, 23 Dec 2002, Beauford.2002 wrote:
  
I have a function at the bottom of my script which is called from
  withing an
if/else statement. If I take it out of the if/else and just call the
function it works fine (except I don't get the results I want). So
it
appears where you are calling it from does matter. See the examples
  below.
This isn't the first time either, I have had to redo several scripts
for
this project because of it.  If I'm doing this wrong based on the
  examples
below, please let me know. Thanks.
   
i.e.
   
This doesn't work.This
does.
   
some code ..
some
  code
.
   
If ($bob) { gotofunction($bob); }
  gotofunction($bob);
elseif ($sally) { gotonextfunction($sally); }
gotonextfunction($sally)
   else { gotolastfunction(); }
gotolastfunction()
some other code . some
other
code
   
function gotofunction($bob)   function
gotofunction($bob)
function gotonextfunction() function
gotonextfunction()
function gotolastfunction()
function
gotolastfunction()
   
   
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Sunday, December 22, 2002 11:16 PM
Subject: Re: [PHP] Undefined Functions
   
   
 An undefined function error has nothing to do with where you are
  calling
 the function from.  It has to do with whether or not you have
defined
  the
 function you are calling.

 -Rasmus

 On Sun, 22 Dec 2002, Beauford.2002 wrote:

  Hi,
 
  I previously asked a question about getting undefined function
  errors in
my
  script and someone mentioned that it may be that I am calling it
  from
within
  an if or else statement. This turned out to be the case. Now the
question -
  is there a way around this? What I need to do resolves around
many
different
  conditions, and depending on the what's what I call the
necessary
function.
  I have looked my script over and over and can not see any other
way
  of
doing
  this. I am fairly new to PHP and maybe there is a better way,
and
  I'm
open
  to suggestions.
 
  TIA
 
  Example:
 
  if ($a == $b) call function one;
 
  elseif ($a   $b) call function two;
  elseif ($a  == $c) call function two;
  elseif ($a   $b) call function two;
  

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
Like John said, REFERER isn't always set, and that looks to be the case 
here.  One thing I did notice is that the redirect comes thru on a 
different port.  If this is consistant, you may be able to use this.

John Taylor-Johnston wrote:
echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );



On the redirect from http://compcanlit.ca/, I get:

Array
(
[DOCUMENT_ROOT] = /var/www/html2
[HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
[HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
[HTTP_ACCEPT_ENCODING] = gzip
[HTTP_ACCEPT_LANGUAGE] = en,fr
[HTTP_CONNECTION] = Keep-Alive
[HTTP_HOST] = compcanlit.usherbrooke.ca
[HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
[PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
[REDIRECT_STATUS] = 200
[REDIRECT_URL] = /
[REMOTE_ADDR] = 142.169.108.39
[REMOTE_PORT] = 1066
[SCRIPT_FILENAME] = /var/www/html2/index.html
[SERVER_ADDR] = 132.210.13.10
[SERVER_ADMIN] = root@localhost
[SERVER_NAME] = compcanlit.usherbrooke.ca
[SERVER_PORT] = 80
[SERVER_SIGNATURE] =
Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80


[SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.0
[REQUEST_METHOD] = GET
[QUERY_STRING] =
[REQUEST_URI] = /
[SCRIPT_NAME] = /index.html
[PATH_TRANSLATED] = /var/www/html2/index.html
[PHP_SELF] = /index.html
[argv] = Array
(
)

[argc] = 0






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
 [SERVER_PORT] = 80

Server port does not change.

Will it do anything to change my php.ini?

session.referer_check =

It is set to nothing at the moment, copied and pasted.

How do I check for the port number? My redirects come through:

[REMOTE_PORT] = 1070
[REMOTE_PORT] = 1074

They are also increasing. It's a bit like a counter :) no?

Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:

[REMOTE_PORT] = 1079

John

John Nichel wrote:

 Like John said, REFERER isn't always set, and that looks to be the case
 here.  One thing I did notice is that the redirect comes thru on a
 different port.  If this is consistant, you may be able to use this.

 John Taylor-Johnston wrote:
 echo ( pre\n );
 print_r ( $_SERVER );
 echo ( /pre\n );
 
 
  On the redirect from http://compcanlit.ca/, I get:
 
  Array
  (
  [DOCUMENT_ROOT] = /var/www/html2
  [HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
image/png, */*
  [HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
  [HTTP_ACCEPT_ENCODING] = gzip
  [HTTP_ACCEPT_LANGUAGE] = en,fr
  [HTTP_CONNECTION] = Keep-Alive
  [HTTP_HOST] = compcanlit.usherbrooke.ca
  [HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
  [PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
  [REDIRECT_STATUS] = 200
  [REDIRECT_URL] = /
  [REMOTE_ADDR] = 142.169.108.39
  [REMOTE_PORT] = 1066
  [SCRIPT_FILENAME] = /var/www/html2/index.html
  [SERVER_ADDR] = 132.210.13.10
  [SERVER_ADMIN] = root@localhost
  [SERVER_NAME] = compcanlit.usherbrooke.ca
  [SERVER_PORT] = 80
  [SERVER_SIGNATURE] =
  Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80
 
 
  [SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
  [GATEWAY_INTERFACE] = CGI/1.1
  [SERVER_PROTOCOL] = HTTP/1.0
  [REQUEST_METHOD] = GET
  [QUERY_STRING] =
  [REQUEST_URI] = /
  [SCRIPT_NAME] = /index.html
  [PATH_TRANSLATED] = /var/www/html2/index.html
  [PHP_SELF] = /index.html
  [argv] = Array
  (
  )
 
  [argc] = 0
 
 
 

 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
Well, that won't help then.  I saw that REMOTE_PORT was different in 
your last two emails, but if it's ever changing

I'm doing a little testing here on my end and have discovered that 
REFERER isn't set if the server is doing a redirect.  I made a simple 
little two page script.  The first page just contained this (the site 
doesn't have DNS outside of my network)...

header ( Location: http://www.backup.jcn/referer2.php; );

and referer2.php contained...

print_r ( $_SERVER );

When I went through the redirect, REFERER was NOT set, but when I 
clicked on a link from another page, it was set.  I'll look at it a bit 
longer to see if there is anything out there to tell it was redirected, 
but it's not looking good.

John Taylor-Johnston wrote:
[SERVER_PORT] = 80



Server port does not change.

Will it do anything to change my php.ini?

session.referer_check =

It is set to nothing at the moment, copied and pasted.

How do I check for the port number? My redirects come through:



[REMOTE_PORT] = 1070
[REMOTE_PORT] = 1074



They are also increasing. It's a bit like a counter :) no?

Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:



[REMOTE_PORT] = 1079



John

John Nichel wrote:



Like John said, REFERER isn't always set, and that looks to be the case
here.  One thing I did notice is that the redirect comes thru on a
different port.  If this is consistant, you may be able to use this.

John Taylor-Johnston wrote:


echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );



On the redirect from http://compcanlit.ca/, I get:

Array
(
   [DOCUMENT_ROOT] = /var/www/html2
   [HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
   [HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
   [HTTP_ACCEPT_ENCODING] = gzip
   [HTTP_ACCEPT_LANGUAGE] = en,fr
   [HTTP_CONNECTION] = Keep-Alive
   [HTTP_HOST] = compcanlit.usherbrooke.ca
   [HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
   [PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
   [REDIRECT_STATUS] = 200
   [REDIRECT_URL] = /
   [REMOTE_ADDR] = 142.169.108.39
   [REMOTE_PORT] = 1066
   [SCRIPT_FILENAME] = /var/www/html2/index.html
   [SERVER_ADDR] = 132.210.13.10
   [SERVER_ADMIN] = root@localhost
   [SERVER_NAME] = compcanlit.usherbrooke.ca
   [SERVER_PORT] = 80
   [SERVER_SIGNATURE] =
Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80


   [SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
   [GATEWAY_INTERFACE] = CGI/1.1
   [SERVER_PROTOCOL] = HTTP/1.0
   [REQUEST_METHOD] = GET
   [QUERY_STRING] =
   [REQUEST_URI] = /
   [SCRIPT_NAME] = /index.html
   [PATH_TRANSLATED] = /var/www/html2/index.html
   [PHP_SELF] = /index.html
   [argv] = Array
   (
   )

   [argc] = 0





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com



--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Taylor-Johnston
John,
CC: a copy of your next posts. I'll be back on Friday. Jingle Bells and all.
Thanks for thinking about it. What about turning on: session.referer_check =
Or soemthing else in php.ini

John

John Nichel wrote:

 Well, that won't help then.  I saw that REMOTE_PORT was different in
 your last two emails, but if it's ever changing

 I'm doing a little testing here on my end and have discovered that
 REFERER isn't set if the server is doing a redirect.  I made a simple
 little two page script.  The first page just contained this (the site
 doesn't have DNS outside of my network)...

 header ( Location: http://www.backup.jcn/referer2.php; );

 and referer2.php contained...

 print_r ( $_SERVER );

 When I went through the redirect, REFERER was NOT set, but when I
 clicked on a link from another page, it was set.  I'll look at it a bit
 longer to see if there is anything out there to tell it was redirected,
 but it's not looking good.

 John Taylor-Johnston wrote:
 [SERVER_PORT] = 80
 
 
  Server port does not change.
 
  Will it do anything to change my php.ini?
 
  session.referer_check =
 
  It is set to nothing at the moment, copied and pasted.
 
  How do I check for the port number? My redirects come through:
 
 
 [REMOTE_PORT] = 1070
 [REMOTE_PORT] = 1074
 
 
  They are also increasing. It's a bit like a counter :) no?
 
  Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:
 
 
 [REMOTE_PORT] = 1079
 
 
  John
 
  John Nichel wrote:
 
 
 Like John said, REFERER isn't always set, and that looks to be the case
 here.  One thing I did notice is that the redirect comes thru on a
 different port.  If this is consistant, you may be able to use this.
 
 John Taylor-Johnston wrote:
 
 echo ( pre\n );
 print_r ( $_SERVER );
 echo ( /pre\n );
 
 
 On the redirect from http://compcanlit.ca/, I get:
 
 Array
 (
 [DOCUMENT_ROOT] = /var/www/html2
 [HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
image/png, */*
 [HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
 [HTTP_ACCEPT_ENCODING] = gzip
 [HTTP_ACCEPT_LANGUAGE] = en,fr
 [HTTP_CONNECTION] = Keep-Alive
 [HTTP_HOST] = compcanlit.usherbrooke.ca
 [HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
 [PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
 [REDIRECT_STATUS] = 200
 [REDIRECT_URL] = /
 [REMOTE_ADDR] = 142.169.108.39
 [REMOTE_PORT] = 1066
 [SCRIPT_FILENAME] = /var/www/html2/index.html
 [SERVER_ADDR] = 132.210.13.10
 [SERVER_ADMIN] = root@localhost
 [SERVER_NAME] = compcanlit.usherbrooke.ca
 [SERVER_PORT] = 80
 [SERVER_SIGNATURE] =
 Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80
 
 
 [SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
 [GATEWAY_INTERFACE] = CGI/1.1
 [SERVER_PROTOCOL] = HTTP/1.0
 [REQUEST_METHOD] = GET
 [QUERY_STRING] =
 [REQUEST_URI] = /
 [SCRIPT_NAME] = /index.html
 [PATH_TRANSLATED] = /var/www/html2/index.html
 [PHP_SELF] = /index.html
 [argv] = Array
 (
 )
 
 [argc] = 0
 
 
 
 
 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com
 
 
  --
  John Taylor-Johnston
  -
  If it's not open-source, it's Murphy's Law.
 
' ' '   Collège de Sherbrooke:
   ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
 - Université de Sherbrooke:
http://compcanlit.ca/
819-569-2064
 
 
 

 --
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread Jason k Larson
You can't use REMOTE_PORT reliably for this purpose, it will always be 
different, until they get recycled by the server.

How are you performing the redirect?  via PHP, or maybe with Apache and 
a Rewrite rule or something?

Jason k Larson


John Taylor-Johnston wrote:

[SERVER_PORT] = 80


Server port does not change.

Will it do anything to change my php.ini?

session.referer_check =

It is set to nothing at the moment, copied and pasted.

How do I check for the port number? My redirects come through:


[REMOTE_PORT] = 1070
[REMOTE_PORT] = 1074


They are also increasing. It's a bit like a counter :) no?

Even the link to http://compcanlit.usherbrooke.ca makes remote_port 
increase:


[REMOTE_PORT] = 1079


John

John Nichel wrote:


Like John said, REFERER isn't always set, and that looks to be the case
here.  One thing I did notice is that the redirect comes thru on a
different port.  If this is consistant, you may be able to use this.

John Taylor-Johnston wrote:

echo ( 

\n );
print_r ( $_SERVER );
echo ( 


\n );


On the redirect from http://compcanlit.ca/, I get:

Array
(
[DOCUMENT_ROOT] = /var/www/html2
[HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, 
image/pjpeg, image/png, */*
[HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
[HTTP_ACCEPT_ENCODING] = gzip
[HTTP_ACCEPT_LANGUAGE] = en,fr
[HTTP_CONNECTION] = Keep-Alive
[HTTP_HOST] = compcanlit.usherbrooke.ca
[HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
[PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
[REDIRECT_STATUS] = 200
[REDIRECT_URL] = /
[REMOTE_ADDR] = 142.169.108.39
[REMOTE_PORT] = 1066
[SCRIPT_FILENAME] = /var/www/html2/index.html
[SERVER_ADDR] = 132.210.13.10
[SERVER_ADMIN] = root@localhost
[SERVER_NAME] = compcanlit.usherbrooke.ca
[SERVER_PORT] = 80
[SERVER_SIGNATURE] =
Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80


[SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) 
mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.0
[REQUEST_METHOD] = GET
[QUERY_STRING] =
[REQUEST_URI] = /
[SCRIPT_NAME] = /index.html
[PATH_TRANSLATED] = /var/www/html2/index.html
[PHP_SELF] = /index.html
[argv] = Array
(
)

[argc] = 0




--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread Rasmus Lerdorf
Isn't the question about REMOTE_HOST? Why are you talking about referer
stuff at all? The two have nothing to do with each other. REMOTE_HOST is
the resolved version of REMOTE_ADDR and is rarely set as it is way too
time consuming to do a reverse DNS lookup on each ip that connects to your
web server.  But, REMOTE_ADDR is always set and you can use that to see
where requests are coming from.  But this has nothing to do with the
referer.

If you are looking to detect the redirect, then the presence of REDIRECT_*
variables will tell you that, but again, this has nothing to do with the
referer.

If you want to know where something was redirect from, try REDIRECT_URL.

-Rasmus

On Tue, 24 Dec 2002, John Taylor-Johnston wrote:

 John,
 CC: a copy of your next posts. I'll be back on Friday. Jingle Bells and all.
 Thanks for thinking about it. What about turning on: session.referer_check =
 Or soemthing else in php.ini

 John

 John Nichel wrote:

  Well, that won't help then.  I saw that REMOTE_PORT was different in
  your last two emails, but if it's ever changing
 
  I'm doing a little testing here on my end and have discovered that
  REFERER isn't set if the server is doing a redirect.  I made a simple
  little two page script.  The first page just contained this (the site
  doesn't have DNS outside of my network)...
 
  header ( Location: http://www.backup.jcn/referer2.php; );
 
  and referer2.php contained...
 
  print_r ( $_SERVER );
 
  When I went through the redirect, REFERER was NOT set, but when I
  clicked on a link from another page, it was set.  I'll look at it a bit
  longer to see if there is anything out there to tell it was redirected,
  but it's not looking good.
 
  John Taylor-Johnston wrote:
  [SERVER_PORT] = 80
  
  
   Server port does not change.
  
   Will it do anything to change my php.ini?
  
   session.referer_check =
  
   It is set to nothing at the moment, copied and pasted.
  
   How do I check for the port number? My redirects come through:
  
  
  [REMOTE_PORT] = 1070
  [REMOTE_PORT] = 1074
  
  
   They are also increasing. It's a bit like a counter :) no?
  
   Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:
  
  
  [REMOTE_PORT] = 1079
  
  
   John
  
   John Nichel wrote:
  
  
  Like John said, REFERER isn't always set, and that looks to be the case
  here.  One thing I did notice is that the redirect comes thru on a
  different port.  If this is consistant, you may be able to use this.
  
  John Taylor-Johnston wrote:
  
  echo ( pre\n );
  print_r ( $_SERVER );
  echo ( /pre\n );
  
  
  On the redirect from http://compcanlit.ca/, I get:
  
  Array
  (
  [DOCUMENT_ROOT] = /var/www/html2
  [HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
image/png, */*
  [HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
  [HTTP_ACCEPT_ENCODING] = gzip
  [HTTP_ACCEPT_LANGUAGE] = en,fr
  [HTTP_CONNECTION] = Keep-Alive
  [HTTP_HOST] = compcanlit.usherbrooke.ca
  [HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
  [PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
  [REDIRECT_STATUS] = 200
  [REDIRECT_URL] = /
  [REMOTE_ADDR] = 142.169.108.39
  [REMOTE_PORT] = 1066
  [SCRIPT_FILENAME] = /var/www/html2/index.html
  [SERVER_ADDR] = 132.210.13.10
  [SERVER_ADMIN] = root@localhost
  [SERVER_NAME] = compcanlit.usherbrooke.ca
  [SERVER_PORT] = 80
  [SERVER_SIGNATURE] =
  Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80
  
  
  [SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
  [GATEWAY_INTERFACE] = CGI/1.1
  [SERVER_PROTOCOL] = HTTP/1.0
  [REQUEST_METHOD] = GET
  [QUERY_STRING] =
  [REQUEST_URI] = /
  [SCRIPT_NAME] = /index.html
  [PATH_TRANSLATED] = /var/www/html2/index.html
  [PHP_SELF] = /index.html
  [argv] = Array
  (
  )
  
  [argc] = 0
  
  
  
  
  --
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com
  
  
   --
   John Taylor-Johnston
   -
   If it's not open-source, it's Murphy's Law.
  
 ' ' '   Collège de Sherbrooke:
ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
  - Université de Sherbrooke:
 http://compcanlit.ca/
 819-569-2064
  
  
  
 
  --
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com

 --
 John Taylor-Johnston
 -
 If it's not open-source, it's Murphy's Law.

   ' ' '   Collège de Sherbrooke:
  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
   http://compcanlit.ca/
   819-569-2064



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing 

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
All session.referer_check does is make sure that the referering page is 
from within your host, and from what I'm reading, it seems that 
HTTP_REFERER would have to contain something.  Couldn't hurt to try, but 
I don't think it will help you achieve the desired results.

John Taylor-Johnston wrote:
John,
CC: a copy of your next posts. I'll be back on Friday. Jingle Bells and all.
Thanks for thinking about it. What about turning on: session.referer_check =
Or soemthing else in php.ini

John

John Nichel wrote:



Well, that won't help then.  I saw that REMOTE_PORT was different in
your last two emails, but if it's ever changing

I'm doing a little testing here on my end and have discovered that
REFERER isn't set if the server is doing a redirect.  I made a simple
little two page script.  The first page just contained this (the site
doesn't have DNS outside of my network)...

header ( Location: http://www.backup.jcn/referer2.php; );

and referer2.php contained...

print_r ( $_SERVER );

When I went through the redirect, REFERER was NOT set, but when I
clicked on a link from another page, it was set.  I'll look at it a bit
longer to see if there is anything out there to tell it was redirected,
but it's not looking good.

John Taylor-Johnston wrote:


[SERVER_PORT] = 80



Server port does not change.

Will it do anything to change my php.ini?

session.referer_check =

It is set to nothing at the moment, copied and pasted.

How do I check for the port number? My redirects come through:




[REMOTE_PORT] = 1070
[REMOTE_PORT] = 1074



They are also increasing. It's a bit like a counter :) no?

Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:




[REMOTE_PORT] = 1079



John

John Nichel wrote:




Like John said, REFERER isn't always set, and that looks to be the case
here.  One thing I did notice is that the redirect comes thru on a
different port.  If this is consistant, you may be able to use this.

John Taylor-Johnston wrote:



echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );



On the redirect from http://compcanlit.ca/, I get:

Array
(
  [DOCUMENT_ROOT] = /var/www/html2
  [HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
  [HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
  [HTTP_ACCEPT_ENCODING] = gzip
  [HTTP_ACCEPT_LANGUAGE] = en,fr
  [HTTP_CONNECTION] = Keep-Alive
  [HTTP_HOST] = compcanlit.usherbrooke.ca
  [HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
  [PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
  [REDIRECT_STATUS] = 200
  [REDIRECT_URL] = /
  [REMOTE_ADDR] = 142.169.108.39
  [REMOTE_PORT] = 1066
  [SCRIPT_FILENAME] = /var/www/html2/index.html
  [SERVER_ADDR] = 132.210.13.10
  [SERVER_ADMIN] = root@localhost
  [SERVER_NAME] = compcanlit.usherbrooke.ca
  [SERVER_PORT] = 80
  [SERVER_SIGNATURE] =
Apache/1.3.27 Server at compcanlit.usherbrooke.ca Port 80


  [SERVER_SOFTWARE] = Apache/1.3.27 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
  [GATEWAY_INTERFACE] = CGI/1.1
  [SERVER_PROTOCOL] = HTTP/1.0
  [REQUEST_METHOD] = GET
  [QUERY_STRING] =
  [REQUEST_URI] = /
  [SCRIPT_NAME] = /index.html
  [PATH_TRANSLATED] = /var/www/html2/index.html
  [PHP_SELF] = /index.html
  [argv] = Array
  (
  )

  [argc] = 0





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com



--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

 ' ' '   Collège de Sherbrooke:
ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
  - Université de Sherbrooke:
 http://compcanlit.ca/
 819-569-2064





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com



--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064






--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
He's looking to see if there is a redirect.  The thing I'm seeing is 
that if the redirect comes from a php header call, or a url rewrite from 
the server, nothing is set for REDIRECT_URL or HTTP_REFERER.  This is 
the $_SERVER output I get on my machine from a url rewrite and php header

Array
(
[DOCUMENT_ROOT] = /webserver/docs/vhosts/backup
[HTTP_ACCEPT] = 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
[HTTP_ACCEPT_CHARSET] = ISO-8859-1, utf-8;q=0.66, *;q=0.66
[HTTP_ACCEPT_ENCODING] = gzip, deflate, compress;q=0.9
[HTTP_ACCEPT_LANGUAGE] = en-us, en;q=0.50
[HTTP_CACHE_CONTROL] = max-age=0
[HTTP_CONNECTION] = keep-alive
[HTTP_COOKIE] = PHPSESSID=a4a0a7c613f817b0344ff70af03b88ae
[HTTP_HOST] = www.backup.jcn
[HTTP_KEEP_ALIVE] = 300
[HTTP_USER_AGENT] = Mozilla/5.0 (X11; U; Linux i586; en-US; 
rv:1.0.1) Gecko/20020823 Netscape/7.0
[PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
[REMOTE_ADDR] = 11.11.68.1
[REMOTE_PORT] = 2380
[SCRIPT_FILENAME] = /webserver/docs/vhosts/backup/referer2.php
[SERVER_ADDR] = 11.11.68.3
[SERVER_ADMIN] = [EMAIL PROTECTED]
[SERVER_NAME] = www.backup.jcn
[SERVER_PORT] = 80
[SERVER_SIGNATURE] = Apache/1.3.26 Server at www.backup.jcn Port 80
[SERVER_SOFTWARE] = Apache/1.3.26 (Unix) PHP/4.2.3 mod_perl/1.27
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.1
[REQUEST_METHOD] = GET
[QUERY_STRING] =
[REQUEST_URI] = /referer2.php
[SCRIPT_NAME] = /referer2.php
[PATH_TRANSLATED] = /webserver/docs/vhosts/backup/referer2.php
[PHP_SELF] = /referer2.php
[argv] = Array
(
)

[argc] = 0
)

But if I use JavaScript or Meta refresh to do the redirect, I get the 
HTTP_REFERER.  I also get it when I link to the page from another.  I 
didn't get any REDIRECT variables in any of the cases.  Are these 
supposed to be in the $_SERVER array?

Rasmus Lerdorf wrote:
Isn't the question about REMOTE_HOST? Why are you talking about referer
stuff at all? The two have nothing to do with each other. REMOTE_HOST is
the resolved version of REMOTE_ADDR and is rarely set as it is way too
time consuming to do a reverse DNS lookup on each ip that connects to your
web server.  But, REMOTE_ADDR is always set and you can use that to see
where requests are coming from.  But this has nothing to do with the
referer.

If you are looking to detect the redirect, then the presence of REDIRECT_*
variables will tell you that, but again, this has nothing to do with the
referer.

If you want to know where something was redirect from, try REDIRECT_URL.

-Rasmus

On Tue, 24 Dec 2002, John Taylor-Johnston wrote:



John,
CC: a copy of your next posts. I'll be back on Friday. Jingle Bells and all.
Thanks for thinking about it. What about turning on: session.referer_check =
Or soemthing else in php.ini

John

John Nichel wrote:



Well, that won't help then.  I saw that REMOTE_PORT was different in
your last two emails, but if it's ever changing

I'm doing a little testing here on my end and have discovered that
REFERER isn't set if the server is doing a redirect.  I made a simple
little two page script.  The first page just contained this (the site
doesn't have DNS outside of my network)...

header ( Location: http://www.backup.jcn/referer2.php; );

and referer2.php contained...

print_r ( $_SERVER );

When I went through the redirect, REFERER was NOT set, but when I
clicked on a link from another page, it was set.  I'll look at it a bit
longer to see if there is anything out there to tell it was redirected,
but it's not looking good.

John Taylor-Johnston wrote:


[SERVER_PORT] = 80



Server port does not change.

Will it do anything to change my php.ini?

session.referer_check =

It is set to nothing at the moment, copied and pasted.

How do I check for the port number? My redirects come through:




[REMOTE_PORT] = 1070
[REMOTE_PORT] = 1074



They are also increasing. It's a bit like a counter :) no?

Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:




[REMOTE_PORT] = 1079



John

John Nichel wrote:




Like John said, REFERER isn't always set, and that looks to be the case
here.  One thing I did notice is that the redirect comes thru on a
different port.  If this is consistant, you may be able to use this.

John Taylor-Johnston wrote:



echo ( pre\n );
print_r ( $_SERVER );
echo ( /pre\n );



On the redirect from http://compcanlit.ca/, I get:

Array
(
  [DOCUMENT_ROOT] = /var/www/html2
  [HTTP_ACCEPT] = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
  [HTTP_ACCEPT_CHARSET] = iso-8859-1,*,utf-8
  [HTTP_ACCEPT_ENCODING] = gzip
  [HTTP_ACCEPT_LANGUAGE] = en,fr
  [HTTP_CONNECTION] = Keep-Alive
  [HTTP_HOST] = compcanlit.usherbrooke.ca
  [HTTP_USER_AGENT] = Mozilla/4.79 [en]C-CCK-MCD   (Win98; U)
  [PATH] = 

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread Rasmus Lerdorf
Sure, but his phpinfo() does show REDIRECT_* vars as it is the server
doing the redirect.  An external redirect (HTTP Location header) is not
going to show anything as it has nothing to do with the server.

-Rasmus

On Tue, 24 Dec 2002, John Nichel wrote:

 He's looking to see if there is a redirect.  The thing I'm seeing is
 that if the redirect comes from a php header call, or a url rewrite from
 the server, nothing is set for REDIRECT_URL or HTTP_REFERER.  This is
 the $_SERVER output I get on my machine from a url rewrite and php header

 Array
 (
  [DOCUMENT_ROOT] = /webserver/docs/vhosts/backup
  [HTTP_ACCEPT] =
 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
  [HTTP_ACCEPT_CHARSET] = ISO-8859-1, utf-8;q=0.66, *;q=0.66
  [HTTP_ACCEPT_ENCODING] = gzip, deflate, compress;q=0.9
  [HTTP_ACCEPT_LANGUAGE] = en-us, en;q=0.50
  [HTTP_CACHE_CONTROL] = max-age=0
  [HTTP_CONNECTION] = keep-alive
  [HTTP_COOKIE] = PHPSESSID=a4a0a7c613f817b0344ff70af03b88ae
  [HTTP_HOST] = www.backup.jcn
  [HTTP_KEEP_ALIVE] = 300
  [HTTP_USER_AGENT] = Mozilla/5.0 (X11; U; Linux i586; en-US;
 rv:1.0.1) Gecko/20020823 Netscape/7.0
  [PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
  [REMOTE_ADDR] = 11.11.68.1
  [REMOTE_PORT] = 2380
  [SCRIPT_FILENAME] = /webserver/docs/vhosts/backup/referer2.php
  [SERVER_ADDR] = 11.11.68.3
  [SERVER_ADMIN] = [EMAIL PROTECTED]
  [SERVER_NAME] = www.backup.jcn
  [SERVER_PORT] = 80
  [SERVER_SIGNATURE] = Apache/1.3.26 Server at www.backup.jcn Port 80
  [SERVER_SOFTWARE] = Apache/1.3.26 (Unix) PHP/4.2.3 mod_perl/1.27
  [GATEWAY_INTERFACE] = CGI/1.1
  [SERVER_PROTOCOL] = HTTP/1.1
  [REQUEST_METHOD] = GET
  [QUERY_STRING] =
  [REQUEST_URI] = /referer2.php
  [SCRIPT_NAME] = /referer2.php
  [PATH_TRANSLATED] = /webserver/docs/vhosts/backup/referer2.php
  [PHP_SELF] = /referer2.php
  [argv] = Array
  (
  )

  [argc] = 0
 )

 But if I use JavaScript or Meta refresh to do the redirect, I get the
 HTTP_REFERER.  I also get it when I link to the page from another.  I
 didn't get any REDIRECT variables in any of the cases.  Are these
 supposed to be in the $_SERVER array?

 Rasmus Lerdorf wrote:
  Isn't the question about REMOTE_HOST? Why are you talking about referer
  stuff at all? The two have nothing to do with each other. REMOTE_HOST is
  the resolved version of REMOTE_ADDR and is rarely set as it is way too
  time consuming to do a reverse DNS lookup on each ip that connects to your
  web server.  But, REMOTE_ADDR is always set and you can use that to see
  where requests are coming from.  But this has nothing to do with the
  referer.
 
  If you are looking to detect the redirect, then the presence of REDIRECT_*
  variables will tell you that, but again, this has nothing to do with the
  referer.
 
  If you want to know where something was redirect from, try REDIRECT_URL.
 
  -Rasmus
 
  On Tue, 24 Dec 2002, John Taylor-Johnston wrote:
 
 
 John,
 CC: a copy of your next posts. I'll be back on Friday. Jingle Bells and all.
 Thanks for thinking about it. What about turning on: session.referer_check =
 Or soemthing else in php.ini
 
 John
 
 John Nichel wrote:
 
 
 Well, that won't help then.  I saw that REMOTE_PORT was different in
 your last two emails, but if it's ever changing
 
 I'm doing a little testing here on my end and have discovered that
 REFERER isn't set if the server is doing a redirect.  I made a simple
 little two page script.  The first page just contained this (the site
 doesn't have DNS outside of my network)...
 
 header ( Location: http://www.backup.jcn/referer2.php; );
 
 and referer2.php contained...
 
 print_r ( $_SERVER );
 
 When I went through the redirect, REFERER was NOT set, but when I
 clicked on a link from another page, it was set.  I'll look at it a bit
 longer to see if there is anything out there to tell it was redirected,
 but it's not looking good.
 
 John Taylor-Johnston wrote:
 
 [SERVER_PORT] = 80
 
 
 Server port does not change.
 
 Will it do anything to change my php.ini?
 
 session.referer_check =
 
 It is set to nothing at the moment, copied and pasted.
 
 How do I check for the port number? My redirects come through:
 
 
 
 [REMOTE_PORT] = 1070
 [REMOTE_PORT] = 1074
 
 
 They are also increasing. It's a bit like a counter :) no?
 
 Even the link to http://compcanlit.usherbrooke.ca makes remote_port increase:
 
 
 
 [REMOTE_PORT] = 1079
 
 
 John
 
 John Nichel wrote:
 
 
 
 Like John said, REFERER isn't always set, and that looks to be the case
 here.  One thing I did notice is that the redirect comes thru on a
 different port.  If this is consistant, you may be able to use this.
 
 John Taylor-Johnston wrote:
 
 
 echo ( pre\n );
 print_r ( $_SERVER );
 echo ( /pre\n );
 
 
 On the redirect from 

Re: [PHP] Timing mySQL query time.

2002-12-23 Thread Noodle Snacks
Can I do that on the fly?


Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Why not just get the query times from the mysql general query log?

 On Tue, 24 Dec 2002, Noodle Snacks wrote:

  Is there a built in php function for mysql that I can use to time the
last
  query?
 
  or do I have to take the microtime before and after then substract the
first
  from the last?
 
  I want to time how long my queries take
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread John Nichel
Is this something that can be turned on/off in the .ini file or via the 
webserver itself?  Neither my test servers, nor the ISP which hosts my 
sites show any REDIRECT variables. They don't show HTTP_REFERER either, 
but I only expect to see that when a link is clicked from another page 
(I could be wrong about that too).  I set up two urls if you want to 
take a look (referer2.php just calls phpinfo() )...

http://www.by-tor.com/referer1.php (does a header redirect to referer2.php)

http://www.by-tor.com/urlrewrite (does a server redirect to referer2.php)

Rasmus Lerdorf wrote:
Sure, but his phpinfo() does show REDIRECT_* vars as it is the server
doing the redirect.  An external redirect (HTTP Location header) is not
going to show anything as it has nothing to do with the server.

-Rasmus

On Tue, 24 Dec 2002, John Nichel wrote:



He's looking to see if there is a redirect.  The thing I'm seeing is
that if the redirect comes from a php header call, or a url rewrite from
the server, nothing is set for REDIRECT_URL or HTTP_REFERER.  This is
the $_SERVER output I get on my machine from a url rewrite and php header

Array
(
[DOCUMENT_ROOT] = /webserver/docs/vhosts/backup
[HTTP_ACCEPT] =
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
[HTTP_ACCEPT_CHARSET] = ISO-8859-1, utf-8;q=0.66, *;q=0.66
[HTTP_ACCEPT_ENCODING] = gzip, deflate, compress;q=0.9
[HTTP_ACCEPT_LANGUAGE] = en-us, en;q=0.50
[HTTP_CACHE_CONTROL] = max-age=0
[HTTP_CONNECTION] = keep-alive
[HTTP_COOKIE] = PHPSESSID=a4a0a7c613f817b0344ff70af03b88ae
[HTTP_HOST] = www.backup.jcn
[HTTP_KEEP_ALIVE] = 300
[HTTP_USER_AGENT] = Mozilla/5.0 (X11; U; Linux i586; en-US;
rv:1.0.1) Gecko/20020823 Netscape/7.0
[PATH] = /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
[REMOTE_ADDR] = 11.11.68.1
[REMOTE_PORT] = 2380
[SCRIPT_FILENAME] = /webserver/docs/vhosts/backup/referer2.php
[SERVER_ADDR] = 11.11.68.3
[SERVER_ADMIN] = [EMAIL PROTECTED]
[SERVER_NAME] = www.backup.jcn
[SERVER_PORT] = 80
[SERVER_SIGNATURE] = Apache/1.3.26 Server at www.backup.jcn Port 80
[SERVER_SOFTWARE] = Apache/1.3.26 (Unix) PHP/4.2.3 mod_perl/1.27
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.1
[REQUEST_METHOD] = GET
[QUERY_STRING] =
[REQUEST_URI] = /referer2.php
[SCRIPT_NAME] = /referer2.php
[PATH_TRANSLATED] = /webserver/docs/vhosts/backup/referer2.php
[PHP_SELF] = /referer2.php
[argv] = Array
(
)

[argc] = 0
)

But if I use JavaScript or Meta refresh to do the redirect, I get the
HTTP_REFERER.  I also get it when I link to the page from another.  I
didn't get any REDIRECT variables in any of the cases.  Are these
supposed to be in the $_SERVER array?

Rasmus Lerdorf wrote:


Isn't the question about REMOTE_HOST? Why are you talking about referer
stuff at all? The two have nothing to do with each other. REMOTE_HOST is
the resolved version of REMOTE_ADDR and is rarely set as it is way too
time consuming to do a reverse DNS lookup on each ip that connects to your
web server.  But, REMOTE_ADDR is always set and you can use that to see
where requests are coming from.  But this has nothing to do with the
referer.

If you are looking to detect the redirect, then the presence of REDIRECT_*
variables will tell you that, but again, this has nothing to do with the
referer.

If you want to know where something was redirect from, try REDIRECT_URL.

-Rasmus

On Tue, 24 Dec 2002, John Taylor-Johnston wrote:




John,
CC: a copy of your next posts. I'll be back on Friday. Jingle Bells and all.
Thanks for thinking about it. What about turning on: session.referer_check =
Or soemthing else in php.ini

John

John Nichel wrote:




Well, that won't help then.  I saw that REMOTE_PORT was different in
your last two emails, but if it's ever changing

I'm doing a little testing here on my end and have discovered that
REFERER isn't set if the server is doing a redirect.  I made a simple
little two page script.  The first page just contained this (the site
doesn't have DNS outside of my network)...

header ( Location: http://www.backup.jcn/referer2.php; );

and referer2.php contained...

print_r ( $_SERVER );

When I went through the redirect, REFERER was NOT set, but when I
clicked on a link from another page, it was set.  I'll look at it a bit
longer to see if there is anything out there to tell it was redirected,
but it's not looking good.

John Taylor-Johnston wrote:



[SERVER_PORT] = 80



Server port does not change.

Will it do anything to change my php.ini?

session.referer_check =

It is set to nothing at the moment, copied and pasted.

How do I check for the port number? My redirects come through:





[REMOTE_PORT] = 1070
[REMOTE_PORT] = 1074



They are also increasing. It's a bit like a counter :) no?

Even the link to http://compcanlit.usherbrooke.ca 

Re: [PHP] Re: REMOTE_HOST

2002-12-23 Thread Jason k Larson
I created a static link from my dev site to your referer2.php script, 
and your phpinfo listed a HTTP_REFERER as expected.

Jason k Larson


John Nichel wrote:

Is this something that can be turned on/off in the .ini file or via the
webserver itself?  Neither my test servers, nor the ISP which hosts my
sites show any REDIRECT variables. They don't show HTTP_REFERER either,
but I only expect to see that when a link is clicked from another page
(I could be wrong about that too).  I set up two urls if you want to
take a look (referer2.php just calls phpinfo() )...

http://www.by-tor.com/referer1.php (does a header redirect to 
referer2.php)

http://www.by-tor.com/urlrewrite (does a server redirect to referer2.php)




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<    1   2