Web Development: PHP both Client and Server Side? -


this question has answer here:

when php embedded in html happening? isn't case html response object interpreted in browser, how browser handle php? make separate request?

php server side language can embedded in client side languages?

here happens:

  1. someone goes site in browser. triggers @ http request server
  2. your server decides how wants handle request. let's you're using apache: default then, serve index page within documentroot
  3. let's assume index page index.php. on server, php code within index.php executed once. after has executed, html result of page served client
  4. once served client, thing can modify page javascript. php runs on server. no php code sent client.
  5. if javascript wants dynamically edit page information server without reload, can perform ajax request server. entails javascript making network request endpoint (let's say, getnames.php). getnames.php runs on server, , returns it's result (usually in form of echo <something> javascript, can edit page based on received data.

questions?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -