variable interpolation syntax (SERVER_SIGNATURE)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Horst

    variable interpolation syntax (SERVER_SIGNATURE)

    I have a tiny custom 404 script I'm working on; I'd like to imitate the
    standard Apache 404 page insofar as I'd like "Apache/1.3.29 Server at
    www.example.com Port 80" to appear below my 404 message.

    The problem is that when I try to interpolate
    $_SERVER['SERVER_SIGNATU RE'] into the html output of my script it
    produces a link of the following (incorrect) format:

    http://www.example.com/\"mailto:webmas ter@example.com \"

    I've tried placing the contents of SERVER_SIGNATUR E into a variable in
    the php code in my page:

    $VAR = $_SERVER['SERVER_SIGNATU RE'];

    ....and tried direct interpolation in the html output:

    echo "$_SERVER['SERVER_SIGNATU RE']";

    Can I get a clue here?

    Thanks.

  • Peter Horst

    #2
    Re: variable interpolation syntax (SERVER_SIGNATU RE)

    Peter Horst wrote:[color=blue]
    > I have a tiny custom 404 script I'm working on; I'd like to imitate the
    > standard Apache 404 page insofar as I'd like "Apache/1.3.29 Server at
    > www.example.com Port 80" to appear below my 404 message.
    >
    > The problem is that when I try to interpolate
    > $_SERVER['SERVER_SIGNATU RE'] into the html output of my script it
    > produces a link of the following (incorrect) format:
    >
    > http://www.example.com/\"mailto:webmas ter@example.com \"
    >
    > I've tried placing the contents of SERVER_SIGNATUR E into a variable in
    > the php code in my page:
    >
    > $VAR = $_SERVER['SERVER_SIGNATU RE'];
    >
    > ...and tried direct interpolation in the html output:
    >
    > echo "$_SERVER['SERVER_SIGNATU RE']";[/color]

    Didn't figure out why it was happening, but I worked around it by
    eliminating the '\' character in the output string:

    $VAR = str_replace("\\ ", "", $_SERVER['SERVER_SIGNATU RE']);

    Comment

    Working...