|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10838 wierd problem concatenating global string vars
Submitted: 2001-05-13 01:47 UTC Modified: 2001-05-13 14:28 UTC
From: gearond at cvc dot net Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.5 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: gearond at cvc dot net
New email:
PHP Version: OS:


 [2001-05-13 01:47 UTC] gearond at cvc dot net
<the version is two back, but I would 
be hesitant to ask my ISP to change
to 4.0.5 after all the little problems 
I read about. Can you tell me if the following
is fixed in versions > 4.0.3pl1 ?

I get the expected server address ***WITHOUT A SLASH AT THE END***
eg. "my.server.address"
If I do echo($PHP_SELF)
I get the expeted URL relative the the server ***WITH  O-N-E  SLASH** at
eg. "/expected/url/relative/doc_name"

If I do THIS:
  $this_page = "http://" . $HTTP_SERVER_VARS["SERVER_ADDR"] . $PHP_SELF;
  echo( $this_page );
I get, "http://my.server.address//expected/url/relative/doc_name"

There is **ALWAYS** a double slash between the server address and the
doc path,
if the concatenation of those two variables occurs in the same

It works when used as an action for a form, but I don't think it should
do unexpected

If I do **THIS**:
  $this_page = "http://";
  $this_page .= $HTTP_SERVER_VARS["SERVER_ADDR"];
  $this_page .= $PHP_SELF;
I get the correct results,

My provider is using PHP version 4.0.3pl1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-13 04:59 UTC]
This works fine for me, with Apache/1.3.12, php 4.0.3pl1 on Linux,
can you set-up the script that you can download at on your server so that we can see the problem?

 [2001-05-13 14:28 UTC]
user reports:
This is really weird,

IT WORKS, now! I went around and around with this before! I used the
exact same code and it performed the way I described. I had actually
highlighted the code and pasted it into the email.

Sorry to bug you guys.

The location is

Seems to be a user error or something, so closing.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 05:01:28 2024 UTC