PHP “echo” adds white space and line break automatically. How to delete it? [on hold]Postfix character encoding?Simple cronjob issue (I think!)Uploading/Downloading PHP script issue with the Current Dedicated ServerSSH not seeming to run in bash script called via web serverApache executes HTML, but not PHP; PHP CLI worksApache reports a 200 status for non-existent WordPress URLsOverriding memory_limit with .htaccess resulting in mysterious alerts in syslog (suhosin)Apache Error 500 without log info when trying to access to a php5.3 websitephp script from sh from crontab die with no tracesWhat is causing our PHP script to stall?
What's the point of deactivating Num Lock on login screens?
Is "remove commented out code" correct English?
Why do I get two different answers for this counting problem?
Alternative to sending password over mail?
What's the difference between 'rename' and 'mv'?
In a Spin are Both Wings Stalled?
Why is the ratio of two extensive quantities always intensive?
Twin primes whose sum is a cube
prove that the matrix A is diagonalizable
What does it mean to describe someone as a butt steak?
Is there a hemisphere-neutral way of specifying a season?
How to model explosives?
Has there ever been an airliner design involving reducing generator load by installing solar panels?
What killed these X2 caps?
Combinations of multiple lists
How to draw the figure with four pentagons?
Diode datasheet reading
Should I tell management that I intend to leave due to bad software development practices?
Why can't we play rap on piano?
SSH "lag" in LAN on some machines, mixed distros
Doing something right before you need it - expression for this?
Can one be a co-translator of a book, if he does not know the language that the book is translated into?
Can I make "comment-region" comment empty lines?
90's TV series where a boy goes to another dimension through portal near power lines
PHP “echo” adds white space and line break automatically. How to delete it? [on hold]
Postfix character encoding?Simple cronjob issue (I think!)Uploading/Downloading PHP script issue with the Current Dedicated ServerSSH not seeming to run in bash script called via web serverApache executes HTML, but not PHP; PHP CLI worksApache reports a 200 status for non-existent WordPress URLsOverriding memory_limit with .htaccess resulting in mysterious alerts in syslog (suhosin)Apache Error 500 without log info when trying to access to a php5.3 websitephp script from sh from crontab die with no tracesWhat is causing our PHP script to stall?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.
When I view the source code of the response I get following text (with the space and line break):
this.is.my.ip
Why does this happen and how do I fix that?
PHP Version: 7.3.3
php web-server ip
put on hold as off-topic by HBruijn, Ward♦ yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
add a comment |
I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.
When I view the source code of the response I get following text (with the space and line break):
this.is.my.ip
Why does this happen and how do I fix that?
PHP Version: 7.3.3
php web-server ip
put on hold as off-topic by HBruijn, Ward♦ yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
2
OT here at serverfault but you probably have extra characters outside of the actual PHP tags<?php ... ?>that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php
– HBruijn
2 days ago
@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!
– r00tusr
2 days ago
"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "
– HBruijn
2 days ago
add a comment |
I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.
When I view the source code of the response I get following text (with the space and line break):
this.is.my.ip
Why does this happen and how do I fix that?
PHP Version: 7.3.3
php web-server ip
I wanted to create a own IP Lookup page for my bash script. So I made a subdomain ip.DOMAIN.TLD and created a index.php with following content:
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
The problem is that this echo statement adds a white space character at the end of the line which will be recognised by my script (it's also shown in my browser). I've seen other pages like https://myexternalip.com/raw where this white space character does not exist. It doesn't matter what I am echo'ing, it always creates that white space char at the end. So it's not a problem of the REMOTE_ADDR variable.
When I view the source code of the response I get following text (with the space and line break):
this.is.my.ip
Why does this happen and how do I fix that?
PHP Version: 7.3.3
php web-server ip
php web-server ip
asked 2 days ago
r00tusrr00tusr
713
713
put on hold as off-topic by HBruijn, Ward♦ yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
put on hold as off-topic by HBruijn, Ward♦ yesterday
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Ward
2
OT here at serverfault but you probably have extra characters outside of the actual PHP tags<?php ... ?>that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php
– HBruijn
2 days ago
@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!
– r00tusr
2 days ago
"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "
– HBruijn
2 days ago
add a comment |
2
OT here at serverfault but you probably have extra characters outside of the actual PHP tags<?php ... ?>that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php
– HBruijn
2 days ago
@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!
– r00tusr
2 days ago
"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "
– HBruijn
2 days ago
2
2
OT here at serverfault but you probably have extra characters outside of the actual PHP tags
<?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php– HBruijn
2 days ago
OT here at serverfault but you probably have extra characters outside of the actual PHP tags
<?php ... ?> that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php– HBruijn
2 days ago
@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!
– r00tusr
2 days ago
@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!
– r00tusr
2 days ago
"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "
– HBruijn
2 days ago
"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "
– HBruijn
2 days ago
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
2
OT here at serverfault but you probably have extra characters outside of the actual PHP tags
<?php ... ?>that will get returned verbatim. See php.net/manual/en/language.basic-syntax.phptags.php– HBruijn
2 days ago
@HBrujin OMG I feel kinda dumb now... That was my problem. Thank you!
– r00tusr
2 days ago
"If a file contains only PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because... "
– HBruijn
2 days ago