Web Development: PHP both Client and Server Side? -
this question has answer here:
- how php interact html , vice versa? 4 answers
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:
- someone goes site in browser. triggers @ http request server
- your server decides how wants handle request. let's you're using apache: default then, serve
index
page withindocumentroot
- let's assume index page
index.php
. on server, php code withinindex.php
executed once. after has executed, html result of page served client - once served client, thing can modify page javascript. php runs on server. no php code sent client.
- 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 ofecho <something>
javascript, can edit page based on received data.
questions?
Comments
Post a Comment