0

Hi I'm new to programming and making a project exactly like these Real time GPS Tracker on JUST HTML / JS and Google Maps to be run on a handphone My Next step is all users should see others location and one of the answers said

you'd have to send the points to a server-side script using AJAX.

I know how ajax works i just don't know what he meant by server-side script

$.ajax({
url: "sample.php",
context: document.body,
success: function(){
  $(this).addClass("done");
}
});

My Questions is:

  1. Is the code above consider a server-side script? if no any examples
  2. Should i make new .php file?

2 Answers2

0

The code above is not a server side scripting language as the url is still point to a .html page.

A server side scripting language is a language that runs on the server rather than on the client. example of a server side scripting language is php.

0

You have a file that exist in you server so one cannot access it using their browesers.In your case that test.html file is residing in server. it can be .php file .js file ....

Ali
  • 468
  • 1
  • 8
  • 19
  • based on your answer i should separate it from my client-side as for my 1st question is it a server-side script? the one above – Jason Steve Apr 22 '18 at 21:39
  • Basically, you have front-end code where you put you ajax request in. Think of it as a way to constantly request a .php page, sample.php in your case, and get a result from. your mentioned code is in the client side. now you have to create a new php file and in it, do your application logic such as connecting to db, getting the user, etc. Have a look at this link. https://softwareengineering.stackexchange.com/questions/171203/what-are-the-differences-between-server-side-and-client-side-programming – Ali Apr 22 '18 at 21:46