maccaj51
asked on
How do i check if a string contains a specific number?
Dear Experts
This script wont work for some reason...
$ipaddress = gethostbyname($domain);
if ($ipaddress == "127.0.0.1") { $status == "offline";}
else { $status == "online"; }
echo $status;
I know the $ipaddress is 127.0.0.1 but nothing echos
Thanks in advance
This script wont work for some reason...
$ipaddress = gethostbyname($domain);
if ($ipaddress == "127.0.0.1") { $status == "offline";}
else { $status == "online"; }
echo $status;
I know the $ipaddress is 127.0.0.1 but nothing echos
Thanks in advance
Are you quite sure the ip address returned in fact is 127.0.0.1? Either, gethostbyname will return null (misspelling of the host name) or the IP adress retuirned is the one assigned to your computer. In case of a company network this may one starting with 192.168.
To find out:
HTH
Gnarf
To find out:
Check if $ipaddress is null
If it is not, use the echo command or something similar to print it out
Enclose the output into special characters, lets say the pipe sign. This will help you detect leading or trailing white spaces
HTH
Gnarf
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
pratima_mcs GREAT SPOT!!!
Many Thanks
Many Thanks
else { $status = "online"; }
echo $status;