How to get the geographical coordinates using PHP [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Have been working on a project that requires you to get the geographical coordinates of the computer who is viewing the page. I want it using PHP. Please help me. Thanks in advance!

If you have the GeoIP extension installed you can use this:
$geodata = geoip_record_by_name($_SERVER['REMOTE_ADDR']);
$latitude = $geodata['latitude'];
$longitude = $geodata['longitude'];
http://www.php.net/manual/en/intro.geoip.php
Without having this installed or using a third party webservice this won't work, though.

You could get the IP adress with $_SERVER['REMOTE_ADDR'].
Then, there many applications which allow us to searching geolocalisation of a IP adress like google, or RESTful webservices for exemple.
Here is an example of RESTful webservice :
The request : freegeoip.net/{format}/{ip_or_hostname} ;
An example with Google : http://freegeoip.net/json/google.com
If you want more details : http://freegeoip.net/

Related

Chatting on three or four computers via LAN cables [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have made a chat App using node.js and Soket.Io. To use my chat App you just enter your name and then you can start chatting. I can chat by two names in differrent browser of my computer. Now I want to connect three-four computers of my friends via LAN-CABLES and then use this chat App to chat. Can someone help me how to do this? How to carry out this whole process?
try to give the ip address of Lan to your friends,and when they put in the browser.it works.For that just need small networking..

how can i play youtube video with php like a proxy [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
this is site
www.proxfree.net
i live in pakistan. youtube blocked here. so i watch the youtube from this site
www.proxfree.net
kindly anybody php expert help me how can make a youtube watch script like proxfree.net. waiting for help. Thanks in advance
In short (since this question doesn't deserve any better answer as it shows absolutely no effort):
Rent a server in a country that doesn't block YouTube
Make sure the webhost allows proxy-like functionality
Create a form you'll use to input the external website URL
Use cURL to communicate with that external website
There are tons of resources about this. Here's one: http://www.makeuseof.com/tag/create-online-proxy-server-minutes/

GPS Location Coordinaties in PHP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I write a code that gets the current location coordinates (LLA) in my web browser using PHP .
Is it possible by using GPS via HTTP or something like that ?
please help
Thanks
You will need to use the brower's geolocation API, for example as shown here.
Then, you simply pass the parameters to a PHP script using whatever method you like, a form, or a jQuery post.

Display local users using PHP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am developing a PHP website. My requirement is that when a visitor/user visits my website ; ie, on the home/index page I would like to list all registered users who belong to the same location as the website visitor's. For example if the visitor is from a city X in Kolkata, then list all other registered users from X. How can I implement this feature? Is there any PHP function or like that to find the geolocation. I tried HTML5 geolocation. But it didn't worked?
This problem can not be solved exactly in common case. Algorithm is that: use geoip database and client's IP-address to get approximate location. Then, using same geoip-database, select similar IP ranges and, finally, search through other users using selected IP ranges. But remember, that users in most cases are behind NAT's, so this solution will be approximate. But you can ask your users when they are registering - about their location. The method I've described before can be used either for registered and unregistered visitors.
Using any geolocation API will be most efficient for this requirement.

PHP Facebook or twitter-like news feed [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hey guys, I'm creating a website and I'm wondering if any of you know how I can create a PHP facebook-like news feed or one similar to twitter. I prefer facebook's, so if you know of a way or you know of a helpful tutorial, that would greatly help. Thank you.
You can check news every 10 seconds via javascript. And then, javascript runs generate.php . Generate.php generates a feed (i.e. xml feed)

Categories