[SOLVED] Using php to get contents of web page
Posted: Tue Jul 10, 2007 10:51 pm
Alrighty, basically what I want to do is find out the IP Address of my web server because it changes frequently. I only have the web server set up for testing purposes which is why I'm not paying for a static IP Address at this stage.
If I user the built-in php $_SERVER variables, none of them actually provide me with the IP address of my computer. So what I want to do is schedule a php file to run which will open up a page (http://jackson.io/ip/) which prints out only the IP address of the server (or actually, the router in my network).
I then want to read the contents of this web page; check it against a file which has my IP address stored in it; and if the two IP addresses are different (ie. mine has changed), then I want to send an email to the people testing the website notifying them of my new IP Address.
So...how can I actually read the contents of the particular web page retrieved from the above URL?
(PS. credit for the services of the above web page go to: http://jackson.io/ip/service.html).
If I user the built-in php $_SERVER variables, none of them actually provide me with the IP address of my computer. So what I want to do is schedule a php file to run which will open up a page (http://jackson.io/ip/) which prints out only the IP address of the server (or actually, the router in my network).
I then want to read the contents of this web page; check it against a file which has my IP address stored in it; and if the two IP addresses are different (ie. mine has changed), then I want to send an email to the people testing the website notifying them of my new IP Address.
So...how can I actually read the contents of the particular web page retrieved from the above URL?
(PS. credit for the services of the above web page go to: http://jackson.io/ip/service.html).