Hey this is something im not sure how to go about doing, althought it may well be very simple..
I have apache installed on my home computer (but not PHP or anything)
I have a webhost (which does have PHP) and I want to create a php file which would simple tell a user whether or not my home computers apache server is up and running (available or not, like is there an active http web address at *ip address*)
I was looking through the manual @ PHP.NET but wasnt sure where to look
cheers if some one can help me out
is there an active web address at...
Moderator: General Moderators
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
(look into exec ping command)
something like
something like
Code: Select all
<?
$comm='ping -c 1 yoursite.com';
$res=shell_exec($comm);
echo $res;
?>-
jollyjumper
- Forum Contributor
- Posts: 107
- Joined: Sat Jan 25, 2003 11:03 am
You could also use the file command, eg. like:
and check what is in $content.
A better option is to create a very simple textfile(call it online.txt) on your webserver at home, which only shows the text: online
if you would use:
and see if $content contains the word online
Hope this helps you.
Greetz Jolly.
Code: Select all
<?php
$content = file('http://yourwebserveraddressathome/");
?>A better option is to create a very simple textfile(call it online.txt) on your webserver at home, which only shows the text: online
if you would use:
Code: Select all
<?php
$content = file('http://yourwebserveraddressathome/online.txt");
?>Hope this helps you.
Greetz Jolly.