Hello Friends I was Developing an website which i only want to be viewed by Indian (People of india) , and I Want to Get The Two Digit Country Code for that using php. I browsed to http://php.net and tried using geoip_country_code_by_name , geoip_country_code3_by_name and geoip_country_name_by_name but None of Function worked , I have tried on my Existing XAMPP Installation and W3schools PHP runner but it says function not exists and i also have checked to PHP version. What Should i Do. I also Have tried methods form here and after Google(ing) whole day i finally came to ask here .Feel Free to Suggest Edit or Close this Question
Based on some research, the best way seems to be by IP. This link will help you if you go this way.
https://stackoverflow.com/a/13600004/13604954
But some VPN can easily change is on IP.
ref. https://nordvpn.com/blog/vpn-ip-location-changer/
So good luck! 😉
The easiest way will be to asking the user is country and if not what you want, just show another page.
Related
A couple years ago I had a client with a limited budget and a short deadline who wanted a sortable searchable table of their parts inventory online - at the time they had only an excel spreadsheet. I created a database, then I just used Script Artist (because I had it) to do the front end. It all works great and he's been happy with it, except now we'd like to make sure that Google can actually find all 17,000+ parts they have available and not just the first 25.
The page where the inventory is located is just www.thesite.com/inventory.php and the url remains the same no matter what page you're on.
I've been looking around at different options, using pushState vs html snapshots, and I'm not sure what would be the best option or if I can even do anything with the current Script Artist setup or if I should just pitch the whole thing. I'd really rather not have to start over since he still doesn't have much of a budget, so if anyone could give me any input that would be helpful. Thanks.
Firstly thank you for taking the time to look at my question.
I have a project where I have integrate a find nearest location function on a Wordpress website. The functionality should work as:
A user inserts their postcode into the search bar, and the results shown are shops which are nearest to their postcode.
Has anyone done anything like this before and if so do you have any recommendations on plugins or tutorials which could possibly help me.
Thanks
The functionality you are looking is basically radius search for given zip code. I will suggest you to go through with this nice article to get start and complete your task.
https://www.dougv.com/2009/03/27/getting-all-zip-codes-in-a-given-radius-from-a-known-point-zip-code-via-php-and-mysql/
After much research I found a suitable plugin for the job:
https://wordpress.org/plugins/gwebpro-store-locator/
There are many plugins out there with the same functionality, but I chose this one.
I edited the plugin heavily to get it to work how I want it to work.
I am very frustrated with my one old month problem. This is my first web page and it's quite complicated (for me).
My problem is with AND and OR in filtering categories in google maps. All tutorials go in the direction of the OR (golf OR theather). What about Golf and London? The more boxes checked, the less markers on the map.
I have two questions:
(1)
I am trying to follow this tutorial. I guess this is a trivial question: where is the data that is displayed in the panel? (I have followed several other tutorials and never had problems with finding the data, but this one...). I believe this tutorial may solve my second question below.
(2) The goal is to have a real estate page where user-sellers can insert properties for sale and user-buyers can view it, filtering the the data by multiple checkbox and/or drop down menus.
The problem I have is that I can't find a way to coordinate the OR and AND.
OR: I could use the Mike's tutorial and I have studied it very carefully.
I didn't find any tutorial when the filters get more complex.
(2B) I tried to work with my old post, and it works with OR as well. but couldn't find the right code when user only checks one (or two) box (like anything in Berkeley). The code(based on the kind Jobsen's code) required user to fill out all checkboxes all the way to the end, then the marker would show up. Couldn't check only 2 boxes and leave others unchecked. Sometimes I want the first filter (City) to be filtered a second time (Bedrooms). Not add any Berkeley + Bedrooms (2 or 3 or 4). Or only Berkeley. Or Berkeley +zip code + type + bedroom OR any combination. The and / or were not working as expected.
Any help with any of the above will be greatly appreciated. Feel free to add any info in the old post as well.Thank you again for your time.
Answer for the question (1) above, pick one:
(a) CSV file; then take a look at this.
(b) stackoverflow question and answer;
(C) you tube;
i chose CSV format. Here is a screenshot to turn csv format into a table using phpmyadmin.
To do the static tutorial which requires only CSV file and not Json (no need to mess with phpmyadmin): download the csv document, but don't open and save it as csv from MS Excel. Saved it inside the notepad as csv file. No idea about google docs.
Any help with the other part of my question (how to filter database with Jquery or Javascript) will be greatly appreciated.
(Programming Language: PHP v5.3)
I am working on this website where I make search on specific websites using google and bing search APIs.
The Project:
A user can select a website to search from a drop-down list. We have an admin panel on this website. If the admin wants to add a new website to the drop-down list, he has to provide two sample URLs from the site as shown below.
On the submit of form a code goes through input and generates a regex that we later use for pattern matching. The regex is stored in database for later use.
In a different form the visiting user selects a website from the drop-down list. He then enters the search "query" in a text box. We fetch results as JSON using search APIs(as mentioned above) where we use the following query syntax as search string:
"site:website query"
(where we replace "website" with the website user chose for search and replace "query" with user's search query).
The Problem
Now what we have to do is get the best match of the url. The reason for doing a pattern match is that some times there are unwanted links in search results. For example lets say I search on website "www.example.com" for an article names "abcd". Search engines might return these two urls:
1) www.example.com/articles/854/abcd
2) www.example.com/search/abcd
The first url is the one that I want. Now I have two issues to resolve.
1) I know that the code that I wrote to make a regex pattern from sample URLs is never going to be perfect considering that the admin adds websites on regular basis. There can never be enough conditions to check for creating a pattern for different websites from same code. Is there a better way to do this or regex is my only option?
2) I am developing on a machine running Windows 7 OS. preg_match_all() returns results here. But when I move the code to server which is running Linux OS, preg_match_all() does not return any results for the same parameters? I can't seem to get why that is happening. Anyone knows why is this happening?
I have been working on web technologies for only past few weeks, so I don't know if I have better options than regex. I would be very grateful if you could assist me or guide me towards resources where I can find solution for my problems.
About question 1:
I can't quite grasp what you're trying to accomplish so I can't give any valid opinion.
Regarding question 2:
If both servers are running the same version of PHP, the regex library used ought to be the same. You can test this, however, by making a mock static file or string to test against the regex and see if the results are the same.
Since you're grabbing results from the search engines and then parsing them, the data retrieve might not be the same. Google/Bing change part of the data regarding the OS you use and that might alter preg results.
I recently built a quiz web application using PHP and MySQL (www.ReadySetQuiz.ME) The format looks something like this:
When did we declare Independence from the British?
1775
1777
1776
1774
The Louisiana Purchase was an aquisition from which country?
England
France
Spain
Germany
The answers are a list of radio buttons. After you answer all the questions you hit the submit button and it shows how many you got correct and a breakdown of each question: whether you chose the correct answer (if not, which was the correct answer) and a distribution of previous users' choices.
One big problem I'd like to solve with this current quiz design is people can just open another tab in their browser and Google the answer. I'd like to only show 1 problem at a time and add a time limit to encourage quick responses, and consequently, eliminate the aforementioned problem.
So, I'm looking for some input/guidance - big picture (50,000 feet). How do I make it so one question is presented at a time and users only have a few seconds to answer the question? Do I use JavaScript? Are there any new improvements in HTML5 that can help me accomplish something like this? I'm really just looking for what I need to learn next. Thanks for your time!
Question1) How do I make it so one question is presented at a time and users only have a few seconds to answer the question?
You need to use a countdown/timer to present the user for a minute of less.
Question 2) Do I use JavaScript?
Yeah you can use javascript and use jQuery to make your life easier.
Also disabling right click menu and text selection in the browser window (using js) will make it difficult for the user to just copy the keyword and paste it in a new browser and search. So if they will have to type the question/keywords it will take time.