php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43156 not getting results
Submitted: 2007-10-31 04:42 UTC Modified: 2007-10-31 08:51 UTC
From: ocknu at comcast dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.4 OS: vista x64
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ocknu at comcast dot net
New email:
PHP Version: OS:

 

 [2007-10-31 04:42 UTC] ocknu at comcast dot net
Description:
------------
can not get the code to work right. instead of giving a true respond it gives a false ll the time. why?
running from url http://127.0.0.1


Reproduce code:
---------------
echo "Checking current url <br>";

if (stristr($url, '127.0.0.1') === TRUE) {
        echo '<font color="red">You are running as localhost(127.0.0.1), this is not smart and can result in wrong paths</font><br>'; 
}
elseif (stristr($url, 'localhost') === TRUE) {
        echo '<font color="red">You are running as localhost, this is not smart and can result in wrong paths</font><br>'; 
}


echo '<font color="blue">Found url: ';    
echo $url."</font><br>"; 


Expected result:
----------------
 You are running as localhost(127.0.0.1), this is not smart and can result in wrong paths    


Actual result:
--------------
found url: 127.0.0.1    

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-31 08:51 UTC] scottmac@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

stristr doesn't return true on success.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 15:01:31 2025 UTC