Hi All,
How to read data from server using php? Actually i'm connecting an external device to my system. That device send some data to server via GPRS. But i dont know how to get/see that data from server? Please Help Me.

Recommended Answers

All 4 Replies

Hi,
In what format your data is stored?
is is databse? is it file?........ Please provide more information

1)if it is database use this

http://www.w3schools.com/PHP/php_mysql_select.asp

or
2) if it is file

$url="http://www.example.com/filename";

$xmlData=file_get_contents($url);

You will get file contents into this $xmlData variable.

Hi All,
How to read data from server using php? Actually i'm connecting an external device to my system. That device send some data to server via GPRS. But i dont know how to get/see that data from server? Please Help Me.

Hi,
In what format your data is stored?
is is databse? is it file?........ Please provide more information

1)if it is database use this

http://www.w3schools.com/PHP/php_mysql_select.asp

or
2) if it is file

$url="http://www.example.com/filename";

$xmlData=file_get_contents($url);

You will get file contents into this $xmlData variable.

Hi arunmagar,
Thanks for ur reply.

Actually i dont know the type of the file that the external device sent. I'm trying to listen that file using "TCP listener". The TCP Listener request the port no and ip address of the server. But i dont know that in which port the data to sent by the device. Do you have any idea to find the port that receive the data from the external device that to be connected with GPRS.

Member Avatar for diafol

Have you searched for info from the manufacturer's site?

Hi Friends,
I got data from the server by Natting the virtual server with one port value.And listen that port using "TCP Listener". This problem solved.
But now i want to store that date in mysql db. Anybody know how to read a port using php and store the data in mysql?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.