PDA

View Full Version : How to Connect a Website to a Server Using PHP?



Penguin Guy
April 4th, 2009, 12:45 PM
I know very little about HTML or PHP or Servers, so can someone give me a very basic idea what I should do to get a website on a server to connect to another server.

I want the website to connect and download data at 23:00 - 8:00 (preferably at midnight). The data must be stored for use during the day. The website should check the server for updates every night. It would also be nice to have a bit of background information on how servers work.

shadow_code
April 5th, 2009, 04:04 AM
Well I guess you'd have to figure out:


What format the data is in
Is the server publicly available (or in the local network)

The easiest way would probably be to serve the data over the Web (from the server) and then PHP could easily save this to a database.

slavik
April 5th, 2009, 04:08 AM
I know very little about HTML or PHP or Servers, so can someone give me a very basic idea what I should do to get a website to connect to a server.

I want the website to connect and download data at 23:00 - 8:00 (preferably at midnight). The data must be stored for use during the day. The website should check the server for updates every night. It would also be nice to have a bit of background information on how servers work.
please clarify on what you are trying to complish.

Penguin Guy
April 5th, 2009, 11:53 AM
The server requires a password and the format is XML. I'm mainly interested in getting connected with the server rather than the reading XML part.

shadow_code
April 5th, 2009, 04:09 PM
Is the server in the same local network as the Web Server (the website)? Otherwise it will need to be accessible from the Internet (it's own IP etc).

Penguin Guy
April 5th, 2009, 04:10 PM
No, it is not local. Yes, it is acessable from the internet with a password.

cabalas
April 6th, 2009, 12:04 AM
How do they make the data available, you say it needs a password but what protocol are they using http, ftp, etc?

samjh
April 6th, 2009, 01:33 AM
I know very little about HTML or PHP or Servers, so can someone give me a very basic idea what I should do to get a website to connect to a server.

I want the website to connect and download data at 23:00 - 8:00 (preferably at midnight). The data must be stored for use during the day. The website should check the server for updates every night. It would also be nice to have a bit of background information on how servers work.

???

Your request doesn't really make sense. A "website" doesn't connect to a server, because a website resides on the server. A user's web browser connects to a server and renders the website served by that server in the browser window.

If you want the server which hosts a website to connect to a different server and download data, then you can accomplish that using a cron (http://en.wikipedia.org/wiki/Cron) job and bash (http://en.wikipedia.org/wiki/Bash) scripts (if the server is Linux).

Penguin Guy
April 6th, 2009, 10:34 AM
Yes I want the website to connect to another server, and it is using http.

cabalas
April 6th, 2009, 11:08 AM
This doesn't really seem like the sort of thing a webpage should be doing, if I was you I would just set up a cron job and use wget/curl to grab the file(s).

Penguin Guy
April 6th, 2009, 11:35 AM
Ok, I'll take you guys advice and just forget it. Thanks for helping anyway.